Types: Route<TUrl, TMatches>
type Route<TUrl, TMatches> = TUrl & object;Represents the structure of a route within the application. Return value of createRoute
Type Declaration
context
context: RouteContextOf<TMatches>;Related routes and rejections for the route. The context is exposed to the hooks and props callback functions for this route.
id
id: string;Unique identifier for the route, generated by router.
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: RouteMetaOf<TMatches>;Represents additional metadata associated with a route, combined with any parents.
name
name: RouteNameOf<TMatches>;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: RouteStateOf<TMatches>;Represents the schema of the route state, combined with any parents.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TUrl extends Url | Url | The url the route resolves to, combined with any parents. Intersected into the route. |
TMatches extends CreatedRouteOptions[] | CreatedRouteOptions[] | The options of the route and its ancestors, indexed by depth. Name, meta, state, and context are all derived from this, including each route's views. |