Class Route<ParentRoute, Params, Data, Context>

A route that can be rendered by a router.

Note: Prefer createRoute over a direct Route instantiation.

Type Parameters

  • ParentRoute extends Route<any, any, Context> | null = any

    A parent route or null if there is no parent.

  • Params extends Dict = any

    Route params.

  • Data = any

    Data loaded by a route.

  • Context = any

    A router context.

Constructors

Methods

Properties

component: undefined | ComponentType

A component rendered by the route, or undefined if a lazyComponent isn't loaded.

dataLoader: undefined | ((options: DataLoaderOptions<Params, Context>) => Data | PromiseLike<Data>)

A callback that loads data required to render a route.

Loader options.

errorComponent: undefined | ComponentType

A component that is rendered when an error was thrown during route rendering.

loadComponent: (() => Promise<ComponentType>)

Loads RouteOptions.lazyComponent once and caches it forever, unless an error occurred during loading.

loadingAppearance: undefined | LoadingAppearance

What to render when a component or data are being loaded.

loadingComponent: undefined | ComponentType

A component that is rendered when a route is being loaded.

notFoundComponent: undefined | ComponentType

A component that is rendered if notFound was called during route loading or rendering

paramsAdapter: undefined | ParamsAdapter<Params>

An adapter that can validate and transform params extracted from the Location.pathname and Location.searchParams.

If paramsAdapter throws during parsing, then route isn't matched and error is ignored.

parentRoute: ParentRoute

A parent route or null if there is no parent.

pathnameTemplate: PathnameTemplate

A template of a pathname pattern.

renderingDisposition: undefined | RenderingDisposition

Where the route is rendered.