Open eMerzh opened 3 weeks ago
useParams
just uses useMatch
same with useLocation
they all use the same underlying properties off of match
so i'm not sure how you'd get different results between them. I'd need a reproduction to try and see what's going on.
I will say that found doesn't give params related to any specific route, it always provides all the params for the matched location. However it's not generally expected that the previous route is given the new params on a navigation since it should render the new route
Hello, i face some kind of trouble here... maybe it's a misunderstanding.
i have found + found relay, i have a bunch of routes using getComponent to get the appropriate render,
If in my route i use the useLocation for example to get the location params somewhere down the tree, i might receive at some point params that are totally not related to the current route (and clear the params related to this one)
for example
if i navigate from blogpost/12 , to tag/23 route, and BlogPost use a useParams() , then BlogPost will receive id: 23 which is a bit strange ...
the issue does not occurs if a take the param from the match props.
but then it makes the useLocation/useParams hook pretty hard to use 🤔
could you help me?
Thanks :)