Skip to content

Type Alias: SolidRouterHooks

API / @xmachines/play-solid-router / SolidRouterHooks

type SolidRouterHooks = object;

Defined in: packages/play-solid-router/src/play-router-provider.tsx:37

The three results of the Solid Router hooks that PlayRouterProvider and SolidRouterBridge need. Give them directly from the hook calls of your component:

const navigate = useNavigate(); // → SolidRouterHooks.navigate
const location = useLocation(); // → SolidRouterHooks.location
const params = useParams(); // → SolidRouterHooks.params
  • navigate — the bridge pushes each URL change with it, when the currentRoute of the actor changes.
  • location — the bridge reads pathname and search at the moment of connect(), for a deep link. Each later change of the pathname then goes to the actor, through createEffect.
  • params — the path parameters of the current route segment, which Solid parsed already. The bridge uses them directly in extractParams(), and it parses them not again with URLPattern.

Properties

location

location: Location;

Defined in: packages/play-solid-router/src/play-router-provider.tsx:39


navigate: Navigator;

Defined in: packages/play-solid-router/src/play-router-provider.tsx:38


params

params: Params;

Defined in: packages/play-solid-router/src/play-router-provider.tsx:40