Class Route<Parent, Params, Data, Context>

A route that can be rendered by a router.

Type Parameters

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

    A parent route or null if there is no parent.

  • Params extends object | void = any

    Route params.

  • Data = any

    Data loaded by a route.

  • Context = any

    A context required by a data loader.

Constructors

Properties

errorComponent: undefined | ComponentType

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

getComponent: (() => ComponentType | Promise<ComponentType>)

Loads and caches a route component.

loader: undefined | ((params: Params, context: Context) => Data | PromiseLike<Data>)

Loads data required to render a route.

Route params extracted from a location.

A RouterProps.context provided to a Router.

loadingAppearance: LoadingAppearance

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

loadingComponent: undefined | ComponentType

A component that is rendered when a component or data are being loaded.

notFoundComponent: undefined | ComponentType

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

paramsAdapter: undefined | ParamsAdapter<Params>

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

parent: Parent

A parent route or null if there is no parent.

pathnameTemplate: PathnameTemplate

A template of a pathname pattern.

Methods

  • Prefetches a component and data of this route and its ancestors.

    Parameters

    Returns void

  • Prefetches a component and data of this route and its ancestors.

    Parameters

    Returns void