Skip to content

Interface: RouteContext

API / @xmachines/play-xstate / RouteContext

Defined in: packages/play-xstate/src/routing/types.ts:19

Route build context from machine context.

All URL parameter substitution must go through params — flat context fields are not inspected. This is intentional: the index signature was removed to enable compile-time validation of context shapes and IDE autocomplete on context fields.

Machines using formatPlayRouteTransitions have params and query assigned automatically from each play.route event. Machines that call buildRouteUrl directly must populate params explicitly.

Properties

PropertyTypeDescriptionDefined in
basePath?stringBase path for relative routespackages/play-xstate/src/routing/types.ts:21
hash?stringHash fragmentpackages/play-xstate/src/routing/types.ts:27
params?Record<string, unknown>Path-only route parameters to substitute (e.g., :userId from /profile/:userId)packages/play-xstate/src/routing/types.ts:23
query?Record<string, unknown>Query parameterspackages/play-xstate/src/routing/types.ts:25