Skip to content

Types: Route<TName, THost, TPath, TQuery, THash, TMeta, TState, TMatches>

ts
type Route<TName, THost, TPath, TQuery, THash, TMeta, TState, TMatches> = object;

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

Type Parameters

Type ParameterDefault typeDescription
TName extends stringstringRepresents the unique name identifying the route, typically a string.
THost extends WithParamsWithParams-
TPath extends WithParamsWithParamsThe type or structure of the route's path.
TQuery extends WithParamsWithParamsThe type or structure of the query parameters associated with the route.
THash extends WithParamsWithParams-
TMeta extends RouteMetaRouteMeta-
TState extends Record<string, Param>Record<string, Param>-
TMatches extends CreatedRouteOptions[]CreatedRouteOptions[]-

Properties

PropertyTypeDescription
hashTHashRepresents the hash of the route.
hostTHostRepresents the host for this route. Used for external routes.
idstringUnique identifier for the route, generated by router.
matchedLastInArray<TMatches, CreatedRouteOptions>The specific route properties that were matched in the current route.
matchesTMatchesThe specific route properties that were matched in the current route, including any ancestors. Order of routes will be from greatest ancestor to narrowest matched.
metaTMetaRepresents additional metadata associated with a route, combined with any parents.
nameTNameIdentifier for the route as defined by user. Name must be unique among named routes. Name is used for routing and for matching.
pathTPathRepresents the structured path of the route, including path params.
prefetch?PrefetchConfigDetermines what assets are prefetched when router-link is rendered for this route. Overrides router level prefetch.
queryTQueryRepresents the structured query of the route, including query params.
stateTStateRepresents the schema of the route state, combined with any parents.