useMatch
Edit this pageuseMatch
takes an accessor that returns the path and creates a Memo that returns match information if the current path matches the provided path.
Useful for determining if a given path matches the current route.
As a second parameter, useMatch
also accepts a group of MatchFilters
.
These filteres allow for a more granular check.
The filters are the same used by the <Router>
itself and they accept either a an array of strings, or a regular expression. Additionally, there's a boolean
option to match a route only if it has, or doesn't have, the HTML extension.
Finally, any parameter can be determined optional by adding a ?
at the end of the parameter name.
The check above will match: