You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce
Replace the search string with something with a space in it. In my example you do that by clicking the button
Expected Behavior
I'd expect the search parameter to resolve to the decoded string right away.
Actual Behavior
The search parameter first returns the encoded version of the space (so for%20example in my repro), and then immediately changes to for example.
I'm using the search parameter to trigger a useEffect (which in turn calls our API), so this kind of blows 😅
Any idea as to why this is happening?
The text was updated successfully, but these errors were encountered:
Hmm, it looks like the double render could be a hash history bug. The hashchange event sometimes fires multiple times in quick succession, so there is some code in createHashHistory that tries to prevent from firing the listener multiple times. But in this case since the query string is apparently changing I bet it's firing once for each encoding.
I opened this issue in the React Router repo first, but it looks like the issue might be rooted in this package.
Reproduction
https://codesandbox.io/s/lively-bash-4vmb6?file=/src/App.js
Steps to reproduce
Replace the search string with something with a space in it. In my example you do that by clicking the button
Expected Behavior
I'd expect the search parameter to resolve to the decoded string right away.
Actual Behavior
The search parameter first returns the encoded version of the space (so for%20example in my repro), and then immediately changes to for example.
I'm using the search parameter to trigger a useEffect (which in turn calls our API), so this kind of blows 😅
Any idea as to why this is happening?
The text was updated successfully, but these errors were encountered: