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

[Bug]: encoded # in path parameter causes route to be evaluated differently #11929

Open
jhroemer opened this issue Aug 26, 2024 · 0 comments
Open
Labels

Comments

@jhroemer
Copy link

jhroemer commented Aug 26, 2024

What version of React Router are you using?

6.26.1

Steps to Reproduce

Included is a basic react app with react router 6.26.1 installed. It uses the <BrowserRouter> and includes two nearly identical links and two <Routes> components with nested routes. One of the routes has a path parameter with an encoded # sign in it, and the other doesn't.

  • Click the first link, this will match the "* sub route" element.
  • Click the second link, this will match the "/posts sub route" element.

Sandbox link: https://codesandbox.io/p/sandbox/react-router-enoded-hash-issue-26klwl?file=%2Fsrc%2FApp.tsx%3A17%2C17

Expected Behavior

The routes should match the same route within the BuggySubRoutes component.

Actual Behavior

The link that has an encoded # in it matches the route with path="*" in the BuggySubRoutes component, and the other link without the encoded # matches the route with path="posts".

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

No branches or pull requests

2 participants
@jhroemer and others