Skip to content

Type Alias: RouteStateNode

API / @xmachines/play-xstate / with-routing / RouteStateNode

type RouteStateNode = object;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:30

The minimal structural shape of one XState state node, as formatPlayRouteTransitions reads it during its walk over the machine config.

This type holds only the fields that the function reads. Every other field of a state node, such as on, entry, and after, passes through the index signature without a change.

Indexable

[key: string]: unknown

Properties

id?

optional id?: string;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:34

The optional explicit state ID, for example "home" or "settings". It is the #id target of a play.route event.


meta?

optional meta?: object;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:36

The state metadata. A meta.route field gives the state a route.

route?

optional route?: RouteMetadata;

The template of the URL path: the string form, for example "/profile/:username", or the object form ({ path, reenter, title }). Both match RouteMetadata. The object form declares the reenter flag of the generated transition, and that flag defaults to false.


on?

optional on?: Record<string, unknown>;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:51

The event handlers of this state. The function reads them where a child asks for a local play.route handler, so that the transitions of the user survive the merge.


states?

optional states?: Record<string, RouteStateNode>;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:46

The nested child states. The function walks them for each further route declaration.