RouteParams
A route's params: what its screen receives, and what a deep link's text parses into.
Verwendung
Type a destination's parameters.
// Type a destination's parameters.
import { navigate, routes, type RouteParams, type RouteTo } from 'kuito';
declare module 'kuito' {
interface Routes {
episode: RouteTo<{ show: number; season: number }>;
}
}
// Logs every navigation with its params before it happens.
function track(route: string, params: RouteParams) {
console.log('open', route, JSON.stringify(params));
}
const destination = routes.episode({ show: 7, season: 2 });
track(destination.route, destination.params);
navigate(destination);Typdeklaration
export type RouteParams = { readonly [name: string]: ParamValue };Typ
{ readonly [name: string]: ParamValue;}Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.