Skip to content

Function: routeExists()

API / @xmachines/play-router / routeExists

function routeExists(tree, path): boolean;

Defined in: query.ts:128

Tells you if a route path is in the tree

The function tests if the path has a state with a meta.route field.

Parameters

ParameterTypeDescription
treeRouteTreeThe route tree, from extractMachineRoutes()
pathstringThe complete route path, for example ‘/dashboard/settings’

Returns

boolean

true when the tree holds the path. In every other case, false