Skip to content

Functions: createRoute()

Call Signature

ts
function createRoute<TName, TPath, TQuery, THash, TMeta, TState>(options): Route<ToName<TName>, Host<"", {}>, ToPath<TPath>, ToQuery<TQuery>, ToHash<THash>, TMeta, TState, TName>

Type Parameters

Type ParameterDefault type
TName extends undefined | stringundefined
TPath extends undefined | string | Path<string, Record<string, undefined | Param>>undefined
TQuery extends undefined | string | Query<string, Record<string, undefined | Param>>undefined
THash extends undefined | string | Hash<undefined | string>undefined
TMeta extends Record<string, unknown>Record<string, unknown>
TState extends Record<string, Param>Record<string, Param>

Parameters

ParameterType
optionsCreateRouteOptions<TName, TPath, TQuery, THash, TMeta> & WithHooks & WithoutComponents & (WithoutParent & (WithState<TState> | WithoutState))

Returns

Route<ToName<TName>, Host<"", {}>, ToPath<TPath>, ToQuery<TQuery>, ToHash<THash>, TMeta, TState, TName>

Call Signature

ts
function createRoute<TParent, TName, TPath, TQuery, THash, TMeta, TState>(options): Route<ToName<TName>, Host<"", {}>, CombinePath<TParent["path"], ToPath<TPath>>, CombineQuery<TParent["query"], ToQuery<TQuery>>, CombineHash<TParent["hash"], ToHash<THash>>, CombineMeta<TMeta, TParent["meta"]>, CombineState<TState, TParent["state"]>, TName | TParent["matches"][number]["name"]>

Type Parameters

Type ParameterDefault type
TParent extends Route<string, Host<string, Record<string, undefined | Param>>, Path<string, Record<string, undefined | Param>>, Query<string, Record<string, undefined | Param>>, Hash<undefined | string>, Record<string, unknown>, Record<string, Param>, undefined | string>-
TName extends undefined | stringundefined
TPath extends undefined | string | Path<string, Record<string, undefined | Param>>undefined
TQuery extends undefined | string | Query<string, Record<string, undefined | Param>>undefined
THash extends undefined | string | Hash<undefined | string>undefined
TMeta extends Record<string, unknown>Record<string, unknown>
TState extends Record<string, Param>Record<string, Param>

Parameters

ParameterType
optionsCreateRouteOptions<TName, TPath, TQuery, THash, TMeta> & WithHooks & WithoutComponents & (WithParent<TParent> & (WithoutState | WithState<TState>))

Returns

Route<ToName<TName>, Host<"", {}>, CombinePath<TParent["path"], ToPath<TPath>>, CombineQuery<TParent["query"], ToQuery<TQuery>>, CombineHash<TParent["hash"], ToHash<THash>>, CombineMeta<TMeta, TParent["meta"]>, CombineState<TState, TParent["state"]>, TName | TParent["matches"][number]["name"]>

Call Signature

ts
function createRoute<TComponent, TName, TPath, TQuery, THash, TMeta, TState>(options): Route<ToName<TName>, Host<"", {}>, ToPath<TPath>, ToQuery<TQuery>, ToHash<THash>, TMeta, TState, TName>

Type Parameters

Type ParameterDefault type
TComponent extends Component-
TName extends undefined | stringundefined
TPath extends undefined | string | Path<string, Record<string, undefined | Param>>undefined
TQuery extends undefined | string | Query<string, Record<string, undefined | Param>>undefined
THash extends undefined | string | Hash<undefined | string>undefined
TMeta extends Record<string, unknown>Record<string, unknown>
TState extends Record<string, Param>Record<string, Param>

Parameters

ParameterType
optionsCreateRouteOptions<TName, TPath, TQuery, THash, TMeta> & WithHooks & WithComponent<TComponent, Route<ToName<TName>, Host<"", {}>, ToPath<TPath>, ToQuery<TQuery>, ToHash<THash>, TMeta, TState, TName>> & (WithoutParent & (WithoutState | WithState<...>))

Returns

Route<ToName<TName>, Host<"", {}>, ToPath<TPath>, ToQuery<TQuery>, ToHash<THash>, TMeta, TState, TName>

Call Signature

ts
function createRoute<TComponent, TParent, TName, TPath, TQuery, THash, TMeta, TState>(options): Route<ToName<TName>, Host<"", {}>, CombinePath<TParent["path"], ToPath<TPath>>, CombineQuery<TParent["query"], ToQuery<TQuery>>, CombineHash<TParent["hash"], ToHash<THash>>, CombineMeta<TMeta, TParent["meta"]>, CombineState<TState, TParent["state"]>, TName | TParent["matches"][number]["name"]>

Type Parameters

Type ParameterDefault type
TComponent extends Component-
TParent extends Route<string, Host<string, Record<string, undefined | Param>>, Path<string, Record<string, undefined | Param>>, Query<string, Record<string, undefined | Param>>, Hash<undefined | string>, Record<string, unknown>, Record<string, Param>, undefined | string>-
TName extends undefined | stringundefined
TPath extends undefined | string | Path<string, Record<string, undefined | Param>>undefined
TQuery extends undefined | string | Query<string, Record<string, undefined | Param>>undefined
THash extends undefined | string | Hash<undefined | string>undefined
TMeta extends Record<string, unknown>Record<string, unknown>
TState extends Record<string, Param>Record<string, Param>

Parameters

ParameterType
optionsCreateRouteOptions<TName, TPath, TQuery, THash, TMeta> & WithHooks & WithComponent<TComponent, Route<ToName<TName>, Host<"", {}>, CombinePath<TParent["path"], ToPath<TPath>>, CombineQuery<...>, CombineHash<...>, CombineMeta<...>, CombineState<...>, TName | TParent["matches"][number]["name"]>> & (WithParent<...> & (WithoutState | WithState<...>))

Returns

Route<ToName<TName>, Host<"", {}>, CombinePath<TParent["path"], ToPath<TPath>>, CombineQuery<TParent["query"], ToQuery<TQuery>>, CombineHash<TParent["hash"], ToHash<THash>>, CombineMeta<TMeta, TParent["meta"]>, CombineState<TState, TParent["state"]>, TName | TParent["matches"][number]["name"]>

Call Signature

ts
function createRoute<TComponents, TName, TPath, TQuery, THash, TMeta, TState>(options): Route<ToName<TName>, Host<"", {}>, ToPath<TPath>, ToQuery<TQuery>, ToHash<THash>, TMeta, TState, TName>

Type Parameters

Type ParameterDefault type
TComponents extends Record<string, Component>-
TName extends undefined | stringundefined
TPath extends undefined | string | Path<string, Record<string, undefined | Param>>undefined
TQuery extends undefined | string | Query<string, Record<string, undefined | Param>>undefined
THash extends undefined | string | Hash<undefined | string>undefined
TMeta extends Record<string, unknown>Record<string, unknown>
TState extends Record<string, Param>Record<string, Param>

Parameters

ParameterType
optionsCreateRouteOptions<TName, TPath, TQuery, THash, TMeta> & WithHooks & WithComponents<TComponents, Route<ToName<TName>, Host<"", {}>, ToPath<TPath>, ToQuery<TQuery>, ToHash<THash>, TMeta, TState, TName>> & (WithoutParent & (WithoutState | WithState<...>))

Returns

Route<ToName<TName>, Host<"", {}>, ToPath<TPath>, ToQuery<TQuery>, ToHash<THash>, TMeta, TState, TName>

Call Signature

ts
function createRoute<TComponents, TParent, TName, TPath, TQuery, THash, TMeta, TState>(options): Route<ToName<TName>, Host<"", {}>, CombinePath<TParent["path"], ToPath<TPath>>, CombineQuery<TParent["query"], ToQuery<TQuery>>, CombineHash<TParent["hash"], ToHash<THash>>, CombineMeta<TMeta, TParent["meta"]>, CombineState<TState, TParent["state"]>, TName | TParent["matches"][number]["name"]>

Type Parameters

Type ParameterDefault type
TComponents extends Record<string, Component>-
TParent extends Route<string, Host<string, Record<string, undefined | Param>>, Path<string, Record<string, undefined | Param>>, Query<string, Record<string, undefined | Param>>, Hash<undefined | string>, Record<string, unknown>, Record<string, Param>, undefined | string>-
TName extends undefined | stringundefined
TPath extends undefined | string | Path<string, Record<string, undefined | Param>>undefined
TQuery extends undefined | string | Query<string, Record<string, undefined | Param>>undefined
THash extends undefined | string | Hash<undefined | string>undefined
TMeta extends Record<string, unknown>Record<string, unknown>
TState extends Record<string, Param>Record<string, Param>

Parameters

ParameterType
optionsCreateRouteOptions<TName, TPath, TQuery, THash, TMeta> & WithHooks & WithComponents<TComponents, Route<ToName<TName>, Host<"", {}>, CombinePath<TParent["path"], ToPath<TPath>>, ... 4 more ..., TName | TParent["matches"][number]["name"]>> & (WithParent<...> & (WithoutState | WithState<...>))

Returns

Route<ToName<TName>, Host<"", {}>, CombinePath<TParent["path"], ToPath<TPath>>, CombineQuery<TParent["query"], ToQuery<TQuery>>, CombineHash<TParent["hash"], ToHash<THash>>, CombineMeta<TMeta, TParent["meta"]>, CombineState<TState, TParent["state"]>, TName | TParent["matches"][number]["name"]>