Skip to content

Class: TanStackSolidRouterBridge

API / @xmachines/play-tanstack-solid-router / TanStackSolidRouterBridge

Defined in: play-tanstack-solid-router/src/solid-router-bridge.ts:42

TanStack Solid Router adapter implementing RouterBridge protocol via TanStackRouterBridgeBase

Remarks

All behavior lives in the shared TanStackRouterBridgeBase (see its docs for the history-subscription rationale and initial-sync semantics). This subclass binds the adapter to the Solid flavour of TanStack Router and keeps the dispose() alias.

Consumers should call onCleanup(() => bridge.disconnect()) in their Solid component to ensure the bridge disconnects on unmount.

Extends

Constructors

Constructor

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

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

Create a TanStack Router bridge

Parameters

ParameterTypeDescription
routerTanStackRouterLikeTanStack Router instance (from createRouter)
actorRoutableActorXMachines actor instance
routeMapTanStackRouteMapLikeBidirectional mapping between state IDs and paths

Returns

TanStackSolidRouterBridge

Inherited from

TanStackRouterBridgeBase.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

TanStackRouterBridgeBase.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

TanStackRouterBridgeBase.disconnect


dispose()

dispose(): void;

Defined in: play-tanstack-solid-router/src/solid-router-bridge.ts:46

Dispose the bridge (alias for disconnect).

Returns

void