Skip to content

Class: ReactRouterBridge

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

Defined in: play-react-router/src/react-router-bridge.ts:27

Abstract base class for all @xmachines router adapter bridges.

Implements RouterBridge protocol and contains all common bridge logic. Subclasses only need to implement the 3 abstract methods that differ between frameworks.

Extends

Constructors

Constructor

new ReactRouterBridge(
router,
actor,
routeMap): ReactRouterBridge;

Defined in: play-react-router/src/react-router-bridge.ts:30

Parameters

ParameterType
routerRouter
actorRoutableActor
routeMapRouteMap

Returns

ReactRouterBridge

Overrides

RouterBridgeBase.constructor

Methods

connect()

connect(): void;

Defined in: play-router/src/router-bridge-base.ts:151

Connect the router bridge to the Actor.

Sets up the TC39 Signal watcher for actor → router direction and starts watching router changes (framework-specific).

Ordering here is part of the bridge contract:

  • lastSyncedPath is seeded in the constructor from actor.currentRoute
  • the actor watcher is installed before adapter router subscriptions
  • initial sync then resolves deep-link vs restore using actor.initialRoute

Adapters that need custom initial-sync behavior should override getInitialRouterPath() rather than reordering connect() steps.

Returns

void

Inherited from

RouterBridgeBase.connect


disconnect()

disconnect(): void;

Defined in: play-router/src/router-bridge-base.ts:256

Disconnect the router bridge from the Actor.

Stops signal watching and unregisters framework-specific router listener.

Returns

void

Inherited from

RouterBridgeBase.disconnect