Skip to content

Types: Route<TUrl, TMatches>

ts
type Route<TUrl, TMatches> = TUrl & object;

Represents the structure of a route within the application. Return value of createRoute

Type Declaration

context

ts
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

ts
id: string;

Unique identifier for the route, generated by router.

matches

ts
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

ts
meta: RouteMetaOf<TMatches>;

Represents additional metadata associated with a route, combined with any parents.

name

ts
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?

ts
optional prefetch?: PrefetchConfig;

Determines what assets are prefetched when router-link is rendered for this route. Overrides router level prefetch.

state

ts
state: RouteStateOf<TMatches>;

Represents the schema of the route state, combined with any parents.

Type Parameters

Type ParameterDefault typeDescription
TUrl extends UrlUrlThe 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.