Types: Route<TName, TUrl, TMeta, TState, TMatches, TContext>
type Route<TName, TUrl, TMeta, TState, TMatches, TContext> = TUrl & object;Represents the structure of a route within the application. Return value of createRoute
Type Declaration
context
context: TContext;Related routes and rejections for the route. The context is exposed to the hooks and props callback functions for this route.
depth
depth: number;Internal
A value that represents how many parents a route has. Used for route matching
hooks
hooks: Hooks[];Internal
The stores for routes including ancestors. Order of routes will be from greatest ancestor to narrowest matched.
id
id: string;Unique identifier for the route, generated by router.
matched
matched: LastInArray<TMatches, CreatedRouteOptions>;The specific route properties that were matched in the current route.
matches
matches: TMatches;The specific route properties that were matched in the current route, including any ancestors. Order of routes will be from greatest ancestor to narrowest matched.
meta
meta: TMeta;Represents additional metadata associated with a route, combined with any parents.
name
name: TName;Identifier for the route as defined by user. Name must be unique among named routes. Name is used for routing and for matching.
prefetch?
optional prefetch: PrefetchConfig;Determines what assets are prefetched when router-link is rendered for this route. Overrides router level prefetch.
state
state: TState;Represents the schema of the route state, combined with any parents.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TName extends string | string | Represents the unique name identifying the route, typically a string. |
TUrl extends Url | Url | - |
TMeta extends RouteMeta | RouteMeta | - |
TState extends Record<string, Param> | Record<string, Param> | - |
TMatches extends CreatedRouteOptions[] | CreatedRouteOptions[] | - |
TContext extends RouteContext[] | RouteContext[] | - |
Template
The type or structure of the route's path.
Template
The type or structure of the query parameters associated with the route.