routes
Every route by name: routes.show({ id: 42 }). Any name makes a
destination; navigating to one no route has is the error.
Utilização
Create a typed destination.
// Create a typed destination.
import { Link, navigate, present, routes, type RouteTo } from 'kuito';
declare module 'kuito' {
interface Routes {
library: RouteTo;
album: RouteTo<{ id: number }>;
rating: RouteTo<{ album: number }, number>;
}
}
<Link to={routes.album({ id: 42 })}>Album 42</Link>;
navigate(routes.library());
// Resolves with what the rating screen dismisses with.
const stars = await present(routes.rating({ album: 42 }));Tipo
RoutesGerado 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.