Skip to content

Function: detectDuplicateRoutes()

Documentation / @xmachines/play-router / detectDuplicateRoutes

function detectDuplicateRoutes(routes): void;

Defined in: validate-routes.ts:51

Detect duplicate route paths

THROWS ERROR when multiple states share the same route path.

Rationale: URL-based routing requires one-to-one mapping between URLs and states. Multiple states at the same path creates ambiguity for browser navigation (back button, direct URL access). Use different paths for different states, or single state with conditional rendering.

Parameters

ParameterTypeDescription
routesRouteInfo[]Array of extracted RouteInfo objects

Returns

void

Throws

If duplicate route paths are detected