Repository navigation
Replies: 1 comment
|
You should pass a pattern to useMatch. So, we treat And you can solve it this way: <Route path="/page/:id" element={<Page path="/page/:id" />} />
// ...
useMatch(props.path) // => useMatch('/page/:id')In addition, I think this method may not be recommended, because we have a more suitable useParams to get the parameters: const params = useParams() |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to migrate v5 to v6,
I have the following routes and Page component
I navigate to /page/123 and print
matchinside thePagecomponentthe match
paramsattribute is an empty object and not including theidAm I missing something or this is a bug?
I also tried
Same problem
All reactions