Skip to content

Variable: PlayRouterProvider

API / @xmachines/play-tanstack-react-router / PlayRouterProvider

const PlayRouterProvider: <TActor>(__namedParameters) => Element;

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

Connects a PlayerActor to TanStack React Router, keeping actor state and browser URL in sync bidirectionally.

The bridge is created once on mount and torn down on unmount. It is also rebuilt if actor, router, or routeMap change identity — so all three props must be stable references (created outside JSX or memoized). Under React <StrictMode> the effect runs twice on mount (connect → disconnect → connect), which the bridge supports.

Type Parameters

Type Parameter
TActor extends PlayActor

Parameters

ParameterType
__namedParametersPlayRouterProviderBaseProps<TanStackRouterLike, TActor>

Returns

Element