router
router copied to clipboard
useMatch doesn't update params['*']
Describe the bug
When I use the useMatch hook with the /* path, it doesn't update the params['*'] value when navigation
Your Example Website or App
https://codesandbox.io/s/react-location-usematch-issue-wq5yq0?file=/src/App.tsx
Steps to Reproduce the Bug or Issue
use the /* path
navigate to the /abc path
change path with the useNavigate hook or with the <Link> component
Expected behavior
if path is /abc we see {'*': 'abc'} in the params, after navigation by the <Link> component we see the new value in the params['*']
Screenshots or Videos
https://user-images.githubusercontent.com/20299845/177189554-12b47a84-af49-46bb-913d-0e9d61cea2a0.mov
Platform
- OS: macOS
- Browser: Chrome
- Version: 3.7.4
Additional context
See the sandbox