When using buildLocation() with params, I expect the values of the params to be encoded. This is the case for spaces and other special characters, but not for slashes. This results in invalid router url's.
But this results in the encoding of the encoded characters…:
/foo%2520bar%252Fbaz
Expected behavior
I expected the slash to be encoded for every param passed to buildLocation. Going further on the example above I expected the output to be:
/foo%20bar%2Fbaz
Describe the bug
When using buildLocation() with params, I expect the values of the params to be encoded. This is the case for spaces and other special characters, but not for slashes. This results in invalid router url's.
Your Example Website or App
https://stackblitz.com/edit/github-lxalsq?file=src%2Froutes%2Findex.tsx
Steps to Reproduce the Bug or Issue
Also see the StackBlitz example above.
buildLocation
with a dynamic route segment and pass a string with a slash..href
is encoded, except for the slash:/foo%20bar/baz
./foo%2520bar%252Fbaz
Expected behavior
I expected the slash to be encoded for every param passed to
buildLocation
. Going further on the example above I expected the output to be:/foo%20bar%2Fbaz
Screenshots or Videos
No response
Platform
Additional context
Thanks for all your work! 🫶️