Interface: PlayRouterProviderProps<TActor>
API / @xmachines/play-tanstack-react-router / PlayRouterProviderProps
Defined in: play-tanstack-react-router/src/play-router-provider.tsx:45
The props of the PlayRouterProvider of TanStack React Router.
router is the TanStack Router instance that createRouter returns.
PlayRouterProviderBaseProps holds the requirement of a stable reference for
actor, for router, and for routeMap.
Extends
Type Parameters
| Type Parameter | Default type |
|---|---|
TActor extends PlayActor | PlayActor |
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-tanstack-react-router/src/create-play-router-provider.tsx:52 |
renderer | (actor, router) => ReactNode | The renderer callback receives the same concrete actor type as the prop. | PlayRouterProviderBaseProps.renderer | play-tanstack-react-router/src/create-play-router-provider.tsx:69 |
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-tanstack-react-router/src/create-play-router-provider.tsx:67 |
router | TanStackRouterLike | The router instance that the bridge keeps in step with the actor. It must be a stable reference. | PlayRouterProviderBaseProps.router | play-tanstack-react-router/src/create-play-router-provider.tsx:54 |