present
Shows to as a new screen, and resolves with what it passes to its
dismiss, or undefined when the user closes it.
Utilização
Return a result from a presented screen
import { Button, present, routes } from 'kuito';
export function NewNote() {
return (
<Button
onPress={async () => {
const note = await present(routes.compose()); // string | undefined
if (note) console.log(note);
}}
>
New note
</Button>
);
}Assinaturas
<R>(to: Destination<R>): Promise<R | undefined>Parâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
R | — | — |
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
to | Destination<R> | Sim | — |
Devolve
Promise<R>
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.