Is it possible to parse a given URL string in relation to the match.path
value?
For instance, if the current route is:
<Route path="/some/path/:type" />
To obtain the type
parameter of the current URL, one can simply use match.params.type. However, how would I go about parsing an arbitrary URL string like const url = "/some/path/foo"
with respect to match.path
?
I am currently using react-router@5
.