Interface: PlayRouterProviderProps<TActor>
API / @xmachines/play-tanstack-solid-router / PlayRouterProviderProps
Defined in: play-tanstack-solid-router/src/play-router-provider.tsx:28
The props of the PlayRouterProvider of TanStack Solid Router.
router is the TanStack Router instance that createRouter returns.
Extends
Type Parameters
| Type Parameter | Default type |
|---|---|
TActor extends RoutableActor | RoutableActor |
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
actor | TActor | The actor to keep in step with the router. It must be a stable reference: give the same actor instance on every render. An actor in the JSX, or a new actor on each render, makes the bridge disconnect and connect again each time. | PlayRouterProviderBaseProps.actor | play-router/src/provider-lifecycle.ts:42 |
basePath? | string | Mounts the routes of the machine under a URL prefix that the host owns, so that the routes of the host and the routes of the machine share one router. actor, router, and routeMap each need a stable reference. This prop needs none, and it rebuilds the bridge never: a change moves the live bridge with setBasePath(), so a host route that renders again with a new prefix keeps the actor, the route map, and its cache. The prefix says WHERE an actor is mounted, and never WHICH actor is mounted. An actor never changes identity, so a prefix segment that IDENTIFIES the actor gives a different actor prop instead, and THAT rebuilds the bridge — which is correct, because one actor takes one bridge. A location outside the prefix belongs completely to the host: the bridge sends no event there, and it corrects no URL there. Every :param needs a value. An unresolved one throws a MissingBasePathParamError out of the mount effect, because the bridge writes no URL without it. Render this component only after the host holds the value, which a route loader or a useParams() call does already. | PlayRouterProviderBaseProps.basePath | play-router/src/provider-lifecycle.ts:80 |
basePathParams? | Record<string, string | number> | The values of the :param segments of PlayRouterProviderBaseProps.basePath, for example { machineId } for basePath="/:machineId/play". An inline object literal is correct here: the provider compares this prop by value, and a move to the same prefix does nothing. | PlayRouterProviderBaseProps.basePathParams | play-router/src/provider-lifecycle.ts:89 |
renderer | (actor, router) => any | The renderer callback receives the same concrete actor type as the prop. | PlayRouterProviderBaseProps.renderer | play-router/src/provider-lifecycle.ts:91 |
routeMap | RouteMap | The route map of both directions, for the lookup between a state ID and a URL path. It must be a stable reference. The provider builds the bridge again on each change of the identity of routeMap. A value in the JSX, for example createRouteMapFromTree(routeTree), makes a new object on every render, and the bridge therefore connects again on every render. Hold the value with useMemo: const routeMap = useMemo(() => createRouteMapFromTree(routeTree), [routeTree]); | PlayRouterProviderBaseProps.routeMap | play-router/src/provider-lifecycle.ts:57 |
router | TanStackRouterLike | The router instance that the bridge keeps in step with the actor. It must be a stable reference. | PlayRouterProviderBaseProps.router | play-router/src/provider-lifecycle.ts:44 |