Skip to content

Variable: ROOT_NODE_ID

API / @xmachines/play-router / index / ROOT_NODE_ID

const ROOT_NODE_ID: "__root__" = "__root__";

Defined in: packages/play-router/src/build-tree.ts:14

The ID and the state ID of the synthetic root node of every RouteTree.

buildRouteTree always makes this node, and no state of a machine declares it. It gives the tree one parent for each absolute route, and it holds routable: false.

A consumer that walks a tree must SKIP this node. createRouteMapFromTree skips it, and getRoutableRoutes of @xmachines/play-router/xstate skips it. A walk that keeps it maps the path / to a state that the machine does not hold.