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

fix(react-router): stabilizing the encoding of path parameters #1490

Merged
merged 5 commits into from Apr 19, 2024

Conversation

SeanCassiere
Copy link
Contributor

@SeanCassiere SeanCassiere commented Apr 19, 2024

closes #1441

This change only impacts the buildLocation method on the Router class, since it is what generates the final href to be committed.

Overall, this change should have zero-impact for current users, whilst still fixing the original problem.

I've tested this with both CSR and SSR and confirmed this change does not break any functionality. Additionally, the useParams hook still returns the decoded value as expected.

Expand

This is what the `useRouterState({ select: s => s.location })` and `useParams` output looks like.

image

And here's a video of the changed behaviour compared following what was in the original issue.

Screen.Recording.2024-04-19.at.19.15.59.mov

Copy link

nx-cloud bot commented Apr 19, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 58409f5. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@SeanCassiere SeanCassiere marked this pull request as ready for review April 19, 2024 08:17
@SeanCassiere SeanCassiere changed the title fix: stabilizing the encoding of path parameters fix(react-router): stabilizing the encoding of path parameters Apr 19, 2024
@SeanCassiere SeanCassiere merged commit 00fb855 into main Apr 19, 2024
7 checks passed
@SeanCassiere SeanCassiere deleted the issue-1441 branch April 19, 2024 21:56
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

Successfully merging this pull request may close these issues.

location.pathname is not encoded on client side navigation
1 participant