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]: Nested route path not resolved when path has a space in 6.4.3, but used to work on 6.4.2 #9580

Closed
rakeshpai opened this issue Nov 10, 2022 · 4 comments · Fixed by #9589
Assignees
Labels

Comments

@rakeshpai
Copy link

What version of React Router are you using?

6.4.3

Steps to Reproduce

I've created a minimal reproduction CodeSandbox here: https://codesandbox.io/s/frosty-black-92if0p?file=/src/App.js

Navigate to /abc, and everything works fine and you should see a 'Hello world' on the screen.

However, navigate to /ab%20c, (URL-encoded space between b and c), and you don't see the 'hello world' anymore, implying that react-router-dom thinks that the path with a space in it is not a match.

This used to work fine until the most recent 6.4.3. To try this out, switch the dependency in the CodeSandbox to 6.4.2 and hit /ab%20c, and you should see the 'hello world'.

Expected Behavior

6.4.3 should match paths that have a space in it.

Actual Behavior

6.4.3 doesn't match paths with a space in it.

@rakeshpai rakeshpai added the bug label Nov 10, 2022
@rakeshpai rakeshpai changed the title [Bug]: Empty route path not resolved when path has a space in 6.4.3, but used to work on 6.4.2 [Bug]: Nested route path not resolved when path has a space in 6.4.3, but used to work on 6.4.2 Nov 10, 2022
@timdorr
Copy link
Member

timdorr commented Nov 10, 2022

@brophdawg11 Is this a regression from #9477?

@brophdawg11
Copy link
Contributor

Thanks for the reproduction @rakeshpai!

@timdorr yeah this looks like we have an encoded/non-encoded mismatch in the logic for calculating the remaining pathname for descendant routes. I'll look into a fix for the next release here 👍

@brophdawg11
Copy link
Contributor

Fixed in #9589, should be out in a prerelease next week and a stable likely the following week 👍

@brophdawg11
Copy link
Contributor

This is now available in 6.4.4-pre.0 if you want to give it a shot!

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

Successfully merging a pull request may close this issue.

3 participants