matchRoutes
react-router

matchRoutes

matchRoutes<RouteObjectType = AgnosticRouteObject>(routes, locationArg, basename): AgnosticRouteMatch<string, RouteObjectType>[] | null

Matches the given routes to a location and returns the match data.

Parameters

  • routes: RouteObjectType[]
  • locationArg: string | Partial<Location>
  • basename: string
Docs and examples CC 4.0