Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useMatchRoute will match routes/about.tsx on routes/$var. #1760

Open
jakst opened this issue Jun 17, 2024 · 0 comments
Open

useMatchRoute will match routes/about.tsx on routes/$var. #1760

jakst opened this issue Jun 17, 2024 · 0 comments

Comments

@jakst
Copy link
Contributor

jakst commented Jun 17, 2024

Describe the bug

When visiting routes/about.tsx, isOnVarRoute is true here

const matchRoute = useMatchRoute();
const isOnVarRoute = Boolean(matchRoute({ to: '/$var' }));

Your Example Website or App

https://stackblitz.com/edit/github-pimzz4?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. Click the About link
  2. Look at the isOn$varRoute value in the header. It says true, even though we're visiting the non-dynamic route /about.

Expected behavior

I expect useMatchRoute to not match static paths in dynamic segments.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant