ScreenProps
What a screen receives: its params, and dismiss to close it with a result.
Verwendung
Create routes and tabs
// app/(shows)/show/[id].tsx
import { Text, type RouteOptions, type ScreenProps } from 'kuito';
export type Params = { id: number };
export const options: RouteOptions<Params> = { title: ({ id }) => `Show ${id}` };
export default function Show({ id }: ScreenProps<Params>) {
return <Text>Show {id}</Text>;
}Typdeklaration
export type ScreenProps<P extends object = {}, R = undefined> = P & {
/** Closes this screen; the `present` that showed it resolves with `result`. */
dismiss: (result?: R) => void;
/**
* How far a back swipe has taken its stack's top screen away: 0 at rest,
* 1 gone, every frame on the UI thread (docs/navigation.md#motion). It
* stays 0 for a presented screen; a screen rendered outside a Router has none.
*/
back?: Motion<number>;
/** The sheet a screen presented as a sheet shows in, as it moves (docs/navigation.md#motion). */
sheet?: SheetMotion;
};Mitglieder 3
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
dismiss | (result?: R) => void | Ja | Closes this screen; the present that showed it resolves with result. |
back | Motion<number> | Nein | How far a back swipe has taken its stack's top screen away: 0 at rest, 1 gone, every frame on the UI thread (docs/navigation.md#motion). It stays 0 for a presented screen; a screen rendered outside a Router has none. |
sheet | SheetMotion | Nein | The sheet a screen presented as a sheet shows in, as it moves (docs/navigation.md#motion). |
dismiss — Methodensignaturen
Signaturen
(result?: R): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
result | R | Nein | — |
Rückgabe
void
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.