Skip to content

Types: CreateRouteOptions<TName, TMeta>

ts
type CreateRouteOptions<TName, TMeta> = object;

Type Parameters

Type ParameterDefault type
TName extends string | undefinedstring | undefined
TMeta extends RouteMetaRouteMeta

Properties

PropertyTypeDescription
component?ComponentAn optional component to render when this route is matched. Default RouterView
components?Record<string, Component>An object of named components to render using named views
context?RouteContext[]Related routes and rejections for the route. The context is exposed to the hooks and props callback functions for this route.
hash?string | UrlPartHash part of URL.
hoist?booleanWhen true, the route will be hoisted to the top of the route tree. The route will continue to inherit meta, state, hooks, matches, and context from it's parent, but not the "url" properties.
meta?TMetaRepresents additional metadata associated with a route, customizable via declaration merging.
name?TNameName for route, used to create route keys and in navigation.
parent?RouteAn optional parent route to nest this route under.
path?string | UrlPartPath part of URL.
prefetch?PrefetchConfigDetermines what assets are prefetched when router-link is rendered for this route. Overrides router level prefetch.
query?string | UrlQueryPartQuery (aka search) part of URL.
state?Record<string, Param>Type params for additional data intended to be stored in history state, all keys will be optional unless a default is provided.