matchPath
react-router

matchPath

matchPath<ParamKey, Path>(pattern, pathname): PathMatch<ParamKey> | null

Performs pattern matching on a URL pathname and returns information about the match.

Parameters

  • pattern: Path | PathPattern
  • pathname: string
Docs and examples CC 4.0