routes
Every route by name: routes.show({ id: 42 }). Any name makes a
destination; navigating to one no route has is the error.
Verwendung
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 }));Typ
RoutesGeneriert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.