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

Search Params plus and whitespace issue #3655

Open
marvinroger opened this issue Mar 4, 2025 · 0 comments
Open

Search Params plus and whitespace issue #3655

marvinroger opened this issue Mar 4, 2025 · 0 comments

Comments

@marvinroger
Copy link

Which project does this relate to?

Router

Describe the bug

If you have a http://localhost:3001/search?q=red%2Byellow+orange URL, according to search params serialization, q should be red+yellow orange. However, inside validateSearch, we currently end up with red+yellow+orange, which, in my understanding, is invalid.

So I have to replace + with , but the actual + would also be replaced with a whitespace, making + actually unusable in search params.

Am I missing something?

Your Example Website or App

https://stackblitz.com/edit/tanstack-react-router-whitespace-issue?file=src%2Froutes%2Findex.tsx

Steps to Reproduce the Bug or Issue

Create a route and log the param in validateSearch. Try with ?q=red%2Byellow+orange and you'll see printed { q: 'red+yellow+orange' }.

Expected behavior

I would have expected to see printed { q: 'red+yellow orange' } or the raw { q: 'red%2Byellow+orange' }.

Screenshots or Videos

Image

Platform

  • OS: macOS 15.3.1
  • Browser: Chromium 133.0.6943.142
  • Version: 1.112.8

Additional context

Thank you for this great library, the type-safety is a game-changer!

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