Triggers RouterProps.onBack.
+Prefetch a content of a route matched by a location and content of its ancestors.
A location or route.
-true
if the route was prefetched, or false
if there's no route in the router that matches the provided
+
true
if the route was prefetched, or false
if there's no route in the router that matches the provided
location.
Triggers RouterProps.onPush with the requested location.
+Triggers RouterProps.onPush with the requested location.
A location or route.
-Triggers RouterProps.onReplace with the requested location.
A location or route.
-An error that is thrown during rendering to signify that the RouteOptions.notFoundFallback must be rendered +
An error that is thrown during rendering to signify that the RouteOptions.notFoundComponent must be rendered instead of the matched route.
-Optional
message: stringOptional
message: stringOptional
options: ErrorOptionsOptional
message: stringOptional
message: stringOptional
options: ErrorOptionsA template of a pathname pattern.
+Creates a new PathnameTemplate instance.
+A pathname pattern from which a template is derived.
+If true
then pathname is matched in a case-sensitive manner.
Readonly
istrue
if pathname is matched in a case-sensitive manner.
Readonly
paramNames of template params.
+Readonly
patternA pathname pattern from which a template is derived.
+Matches a pathname against a pathname pattern.
+Creates a pathname from a template by substituting params, beginning with a "/".
+Optional
params: void | DictA redirect to a location.
-Creates a new Redirect instance.
A location to redirect to.
If true
then
-the permanent redirect is rendered.
If true
then
-the permanent redirect is rendered.
true
if a a permanent redirect must be rendered.
A location to redirect to.
-A route that can be rendered by a router.
+A route that can be rendered by a router.
A parent route or null
if there is no parent.
Route params.
Data loaded by a route.
-A context provided by a Router for a RouteOptions.dataLoader.
-A context required by a data loader.
+Creates a new instance of a Route.
A parent route or null
if there is no parent.
Route params.
Data loaded by a route.
-A context provided by a Router for a RouteOptions.dataLoader.
+A context provided by a Router for a RouteOptions.loader.
A parent route or null
if there is no parent.
Route options.
-Readonly
parentA parent route or null
if there is no parent.
Returns a route location.
+Route options.
+A component that is rendered when an error was thrown during route rendering.
+Loads and caches a route component.
+Loads data required to render a route.
+Route params extracted from a location.
+A RouterProps.context provided to a Router.
+What to render when a component or data are being loaded.
+A component that is rendered when a component or data are being loaded.
+A component that is rendered if notFound was called during route rendering.
+An adapter that can validate and transform params extracted from the Location.pathname and +Location.searchParams.
+Readonly
parentA parent route or null
if there is no parent.
A template of a pathname pattern.
+Prefetches route content and data of this route and its ancestors.
+Optional
options: LocationOptionsLocation options.
+A context provided to a RouteOptions.loader.
+Prefetches a component and data of this route and its ancestors.
+A router that renders a route that matches the provided location.
-A context provided by a Router for a RouteOptions.dataLoader.
-A router that renders a route that matches the provided location.
+A context provided by a Router for a RouteOptions.loader.
+Renders an a
tag that trigger an enclosing router navigation when clicked.
Renders an a
tag that trigger an enclosing router navigation when clicked.
Renders a route provided by an enclosing Router.
+Create the history adapter that reads and writes location to a browser's session history.
-Optional
options: BrowserHistoryOptionsHistory options.
-Create the history adapter that reads and writes location to a browser's session history.
+History options.
+Create the history adapter that reads and writes location to a browser's session history using only URL hash.
+History options.
+Create the history adapter that reads and writes location to an in-memory stack.
+Create the history adapter that reads and writes location to an in-memory stack.
History options.
-Creates a route.
-Route params.
+Route params.
Data loaded by a route.
-A context provided by a Router for a RouteOptions.dataLoader.
-Route options.
-Creates a route that is rendered in the Outlet of a parent route.
+A context provided by a Router for a RouteOptions.loader.
+Optional
options: RouteOptions<Params, Data, Context>Route options.
+Creates a route that is rendered in the Outlet of a parent route.
A parent route.
-Route params.
+Route params.
Data loaded by a route.
A parent route.
-Route options.
-Optional
options: RouteOptions<Params, Data, Parent["_context"]>Route options.
+A URL pathname pattern.
+Optional
component: ComponentTypeA component that is rendered by a route.
+Creates a route that is rendered in the Outlet of a parent route.
+A parent route.
+Route params.
+Throws NotFoundError that causes an enclosing Outlet to render a -RouteOptions.notFoundFallback.
-Optional
message: stringAn optional message of a NotFoundError.
-Throws NotFoundError that causes an enclosing Outlet to render a +RouteOptions.notFoundComponent.
+Optional
message: stringAn optional message of a NotFoundError.
+Throws a Redirect instance that redirects router to a location.
+During SSR, redirects abort rendering. On the client, redirects trigger RouterProps.onReplace.
+Optional
options: RedirectOptionsReturns a history provided by an enclosing HistoryProvider.
+Subscribes component to updates of a history adapter and triggers re-render when history location is changed.
+The history to subscribe to.
+Provides components a way to trigger router navigation.
-Returns the navigation that controls the enclosing router.
+Returns a state of a route or throws if current route isn't the one that was provided.
+Options of createBrowserHistory.
-Optional
searchAn adapter that extracts params from a URL search string and stringifies them back. By default, -an adapter that relies on URLSearchParams is used.
-A history abstraction.
+Adds an entry to the history stack.
+A location to navigate to.
+Modifies the current history entry, replacing it with the state object and URL passed in the method parameters.
+A location to navigate to.
+Optional
baseA default URL base used by History.toURL.
+Optional
searchAn adapter that extracts params from a URL search string and stringifies them back. By default, an adapter that +relies on URLSearchParams is used.
+Props of the Link component.
-Props of the Link component.
+Optional
actionNavigation action triggered by a link.
-Optional
hashA URL fragment identifier.
-If hash begins with a "#" then it is used as is. Otherwise, it is encoded using encodeURIComponent.
-Optional
prefetchWhen to prefetch a route and its data.
-"off"
-
-Optional
stateAn arbitrary data associated with the location.
+Optional
hashA URL fragment identifier.
+If hash begins with a #
then it is used as is. Otherwise, it is encoded using encodeURIComponent.
Optional
prefetchIf true
then link prefetches a route location and its data.
Optional
replaceIf true
then link replaces the current history entry, otherwise link pushes an entry.
Optional
stateAn arbitrary data associated with the location.
A location or route to navigate to when link is clicked.
-A location contains information about the URL path and history state.
-A location contains information about the URL path and history state.
+A URL fragment identifier, beginning with "#".
+Optional
stateAn arbitrary data associated with the location.
+Non-essential Location options.
-Non-essential Location options.
+Optional
hashA URL fragment identifier.
-If hash begins with a "#" then it is used as is. Otherwise, it is encoded using encodeURIComponent.
-Optional
stateAn arbitrary data associated with the location.
-Optional
hashA URL fragment identifier.
+If hash begins with a #
then it is used as is. Otherwise, it is encoded using encodeURIComponent.
Optional
stateAn arbitrary data associated with the location.
+Options of createMemoryHistory.
-A non-empty array of initial history entries.
-Options of createMemoryHistory.
+Optional
baseA default URL base used by History.toURL.
+A non-empty array of initial history entries.
+Optional
searchAn adapter that extracts params from a URL search string and stringifies them back. By default, an adapter that +relies on URLSearchParams is used.
+An adapter that can validate and transform route params.
-An adapter that can validate and transform route params.
+Validates and transforms params extracted from a Location.pathname and Location.searchParams.
+Validates and transforms params extracted from a Location.pathname and Location.searchParams.
A dictionary that contains both pathname and search params.
Route params.
-Optional
toConverts route params to Location.pathname params.
+Optional
toConverts route params to Location.pathname params.
Route params.
Params that should be substituted into a location pathname.
-Optional
toConverts route params to Location.searchParams.
+Optional
toConverts route params to Location.searchParams.
Route params.
A dictionary that is used as Location.searchParams.
-A result returned by PathnameTemplate.match on a successful pathname match.
+Options of the redirect function.
+Optional
isIf true
then the permanent redirect is rendered.
Options of a Route.
-Route params.
+Options of a Route.
+Route params.
Data loaded by a route.
-A context provided by a Router for a dataLoader.
-Optional
contentA content rendered by a route. If undefined
then route implicitly renders Outlet.
Optional
dataLoads data required to render a route. The loaded data is synchronously available inside the content -through useRouteData hook.
-Optional
errorA fallback that is rendered when an error was thrown during route rendering. An error is available through -useRouteError hook.
-Optional
notA fallback that is rendered if notFound was called during route rendering.
-Optional
paramsAn adapter that can validate and transform params extracted from the Location.pathname and -Location.searchParams. Params are available inside the content through useRouteParams hook.
-A URL pathname segment. Leading and trailing slashes are ignored during route matching.
-"/foo/$bar"
-
-Optional
pendingWhat to render when route is being loaded.
-"auto"
-
-Optional
pendingOptional
componentA component that is rendered by a route.
+If both component and lazyComponent are omitted then a route implicitly renders an Outlet.
+Optional
errorA component that is rendered when an error was thrown during route rendering.
+Optional
isIf true
then pathname is matched in a case-sensitive manner.
Optional
lazyA lazy-loaded component that is rendered by a route. A component cached forever if a returned Promise +is fulfilled.
+Optional
loaderLoads data required to render a route.
+Route params extracted from a location.
+A RouterProps.context provided to a Router.
+Optional
loadingWhat to render when lazyComponent or loader are being loaded.
+Optional
loadingA component that is rendered when a lazyComponent or loader are being loaded. Render a skeleton or +a spinner in this component to notify user that a new route is being loaded.
+Optional
notA component that is rendered if notFound was called during route rendering.
+Optional
paramsAn adapter that can validate and transform params extracted from the Location.pathname and +Location.searchParams.
+Validates and transforms params extracted from a Location.pathname and Location.searchParams.
+A dictionary that contains both pathname and search params.
+Route params.
+Optional
pathnameA URL pathname pattern.
+Pattern can include params that conform :[A-Za-z$_][A-Za-z0-9$_]+
. For example "/:userId"
.
Params match a whole segment and cannot be partial. For example, "/teams--:teamId"
is invalid and would throw
+a SyntaxError, while "/teams/:teamId"
is valid.
By default, a param matches a non-empty pathname segment. To make a param optional (so it can match an absent
+segment) follow it by a ?
flag. For example: "/user/:userId?"
matches both "/user"
and "/user/37"
.
Static pathname segments can be optional as well: "/project/task?/:taskId"
.
By default, a param matches a single pathname segment. Follow a param with a *
flag to make it match multiple
+segments. For example: "/:slug*"
matches "/watch"
and "/watch/a/movie"
. Such params are called wildcard
+params.
To make param both wildcard and optional, combine *
and ?
flags: "/:slug*?"
.
To use :
as a character in a pathname pattern, replace it with an encoded
+representation: %3A
.
Data loaded by a RouteOptions.loader, or undefined
data isn't loaded yet.
An error that was thrown during rendering.
+true
if an error was thrown during rendering.
Params of a route.
+Props of the Router component.
+A context provided by a Router for a RouteOptions.loader.
+Optional
childrenChildren rendered by the router. If undefined
, then an Outlet is rendered.
An arbitrary context provided to RouteOptions.loader.
+Optional
errorA component that is rendered when an error was thrown during route rendering.
+The Router-level errorComponent is used only for root routes. Child routes must specify their own +RouteOptions.errorComponent.
+Optional
loadingA component that is rendered when a RouteOptions.lazyComponent or RouteOptions.loader are being +loaded. Render a skeleton or a spinner in this component to notify user that a new route is being loaded.
+The Router-level loadingComponent is used only for root routes. Child routes must specify their own +RouteOptions.loadingComponent.
+The location rendered by the router.
+Optional
notOptional
onTriggered when a router should be navigated to the previous location.
+Optional
onTriggered when a new location must be added to a history stack.
+Optional
onTriggered when a new location must replace the current history entry.
+Routes that the router can render.
+Extracts params from a URL search string and stringifies them back.
+What to render when RouteOptions.lazyComponent or RouteOptions.loader are being loaded.
+A content rendered by a route:
-() => import('./UserPage')
-
-A fallback rendered by the Outlet when RouteContent cannot be rendered for some reason.
-
Provides components a way to trigger router navigation.
-