Skip to content

Interface: PlayRouterProviderProps<TActor>

API / @xmachines/play-react-router / PlayRouterProviderProps

Defined in: play-react-router/src/play-router-provider.tsx:26

Props for the React Router PlayRouterProvider.

router is the React Router instance returned by createBrowserRouter. See PlayRouterProviderBaseProps for the stable-reference requirements on actor, router, and routeMap.

Extends

Type Parameters

Type ParameterDefault type
TActor extends PlayActorPlayActor

Properties

PropertyTypeDescriptionInherited fromDefined in
actorTActorThe actor to sync with the router. Must be a stable reference — pass the same actor instance across renders. Creating the actor inline or re-creating it on every render will cause the bridge to disconnect and reconnect each time.PlayRouterProviderBaseProps.actorplay-react-router/src/create-play-router-provider.tsx:40
renderer(actor, router) => ReactNodeRenderer callback receives the same concrete actor type that was passed in.PlayRouterProviderBaseProps.rendererplay-react-router/src/create-play-router-provider.tsx:57
routeMapRouteMapBidirectional route map for state ID ↔ URL path lookups. Must be a stable reference. The bridge is rebuilt whenever routeMap changes identity. If constructed inline (e.g. createRouteMapFromTree(routeTree) in JSX), a new object is produced on every render and the bridge reconnects every render. Memoize with useMemo: const routeMap = useMemo(() => createRouteMapFromTree(routeTree), [routeTree]);PlayRouterProviderBaseProps.routeMapplay-react-router/src/create-play-router-provider.tsx:55
routerRouterThe router instance the bridge synchronizes with. Must be a stable reference.PlayRouterProviderBaseProps.routerplay-react-router/src/create-play-router-provider.tsx:42