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() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to migrate v5 to v6,
I have the following routes and Page component
I navigate to /page/123 and print
match
inside thePage
componentthe match
params
attribute is an empty object and not including theid
Am I missing something or this is a bug?
I also tried
Same problem
Beta Was this translation helpful? Give feedback.
All reactions