React Router API Reference
    Preparing search index...

    Function matchPath

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

      Type Parameters

      • ParamKey extends string
      • Path extends string

      Parameters

      • pattern: Path | PathPattern<Path>

        The pattern to match against the URL pathname. This can be a string or a PathPattern object. If a string is provided, it will be treated as a pattern with caseSensitive set to false and end set to true.

      • pathname: string

        The URL pathname to match against the pattern.

      Returns null | PathMatch<ParamKey>

      A path match object if the pattern matches the pathname, or null if it does not match.