Skip to content

Interface: RouteContext

API / @xmachines/play-xstate / RouteContext

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

The context of the route construction, from the machine context.

Every substitution of a URL parameter reads params, because the type reads no flat context field. This is deliberate: the type has no index signature now, and the compiler therefore checks the shape of a context, and the IDE completes each context field.

A machine with formatPlayRouteTransitions receives its params field and its query field from each play.route event, and the transitions assign them. A machine that calls buildRouteUrl itself must fill params itself.

Properties

PropertyTypeDescriptionDefined in
basePath?stringThe base path of a relative routepackages/play-xstate/src/routing/types.ts:22
hash?stringThe hash fragmentpackages/play-xstate/src/routing/types.ts:28
params?Record<string, unknown>The parameters of the path to substitute, for example :userId of /profile/:userIdpackages/play-xstate/src/routing/types.ts:24
query?Record<string, unknown>The query parameterspackages/play-xstate/src/routing/types.ts:26