Class: SolidRouterBridge
API / @xmachines/play-solid-router / SolidRouterBridge
Defined in: packages/play-solid-router/src/solid-router-bridge.ts:54
SolidJS Router integration bridge extending RouterBridgeBase
Implements RouterBridge protocol for SolidJS Router using Solid’s reactive primitives. The actor→router direction uses TC39 Signal watcher (from base class). The router→actor direction uses Solid’s createEffect for native reactivity.
Path parameters are extracted from Solid’s useParams() reactive proxy rather than
re-parsing the URL with URLPattern. This means parameterized routes work without the
URLPattern polyfill — Solid’s router has already extracted the values.
Extends
Constructors
Constructor
new SolidRouterBridge( solidNavigate, location, params, actor, routeMap): SolidRouterBridge;Defined in: packages/play-solid-router/src/solid-router-bridge.ts:75
Create a SolidJS Router bridge
CRITICAL: connect() must be called inside a Solid component where hooks are available.
Parameters
| Parameter | Type | Description |
|---|---|---|
solidNavigate | Navigator | Result of useNavigate() hook |
location | LocationLike | Result of useLocation() hook |
params | Params | Result of useParams() hook — used directly for path parameter extraction, avoiding the URLPattern polyfill requirement for parameterized routes |
actor | RoutableActor | XMachines actor instance |
routeMap | RouteMap | Bidirectional state ID ↔ path mapping |
Returns
SolidRouterBridge
Overrides
Methods
connect()
connect(): void;Defined in: packages/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:
lastSyncedPathis seeded in the constructor fromactor.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
disconnect()
disconnect(): void;Defined in: packages/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
dispose()
dispose(): void;Defined in: packages/play-solid-router/src/solid-router-bridge.ts:187
Dispose the bridge (alias for disconnect).
Returns
void
Example
onCleanup(() => bridge.dispose());