Parse a router5 path into its params
Takes your routes
and produces type metadata for consumption in this
library. The result is an array of RouteMeta, one for each route.
Tells solid-typefu-router5
how to render a node if the path leading to
it matches the current route name.
Fallback children to use if none are available to give to render. Default: nothing
Defaults to rendering the children.
Create a [[Match]] node against a given route.
Create a [[Show]] node against a given route.
Not reactive on the routes being used
Prefer this over [[Switch]] + MatchRoute
Create a router for use in solid-js.
I'd recommend putting your router in its own file like './router.ts', then exporting the results of this function, like
import { createRouter, Router as Router5 } from 'router5';
import { createSolidRouter } from 'solid-ts-router';
const routes = [
...
] as const;
// note the "as const" is very important! this causes TypeScript to infer
// `routes` as the narrowest possible type.
function createRouter5(routes: Route<Deps>[]): Router5 {
return createRouter(...)
}
function onStart(router: Router5): void {
// initial redirect here
...
}
export const { Provider, Link, Router } = createSolidRouter({ routes, createRouter5, onStart });
Find whether 'link' is an ancestor of, or equal to, 'here'
Maybe useful for creating your own Link
component.
Generated using TypeDoc
Props for making a
Link
component.You can set default values for any link props using the
defaultLinkProps
option in the initial configuration.