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
| Property | Type | Description | Defined in |
|---|---|---|---|
basePath? | string | The base path of a relative route | packages/play-xstate/src/routing/types.ts:22 |
hash? | string | The hash fragment | packages/play-xstate/src/routing/types.ts:28 |
params? | Record<string, unknown> | The parameters of the path to substitute, for example :userId of /profile/:userId | packages/play-xstate/src/routing/types.ts:24 |
query? | Record<string, unknown> | The query parameters | packages/play-xstate/src/routing/types.ts:26 |