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]: Reading special characters like (+) is not working with useSearchParams #10746

Closed
maazakn opened this issue Jul 30, 2023 · 1 comment
Closed
Labels

Comments

@maazakn
Copy link

maazakn commented Jul 30, 2023

What version of React Router are you using?

6.10.0

Steps to Reproduce

I have created a code sandbox: https://codesandbox.io/s/wispy-water-mps7ly?file=/src/App.js

Use this link to test: https://mps7ly.csb.app/?code=+_somecode

Expected Behavior

"+_somecode"

Actual Behavior

"_somecode"

@maazakn maazakn added the bug label Jul 30, 2023
@timdorr
Copy link
Member

timdorr commented Aug 1, 2023

If you JSON.stringify, you'll see the string you get is " _somecode". The plus is converted into a space character by the browser. If you need that in your URL, you need to URL encode it.

@timdorr timdorr closed this as completed Aug 1, 2023
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