Skip to content

Variable: PlayRouterProvider

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

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

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

Connects a PlayerActor to React Router. It keeps the actor state and the browser URL in step, in both directions.

The component creates the bridge one time, on mount, and it disconnects the bridge on unmount. It also builds the bridge again on a change of the identity of actor, of router, or of routeMap. Therefore all three props must be stable references: create them outside the JSX, or hold them with useMemo.

Type Parameters

Type Parameter
TActor extends PlayActor

Parameters

ParameterType
__namedParametersPlayRouterProviderBaseProps<Router, TActor>

Returns

Element