-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Bug]: useSearchParams reverts to default value when removing the last value #9668
Comments
Could you provide a working reproduction of this in code sandbox, ideally without any component library dependencies? |
@brophdawg11 added |
🤖 Hello there, We just published version Thanks! |
thanks for the quick fix |
🤖 Hello there, We just published version Thanks! |
What version of React Router are you using?
6.4.4
Steps to Reproduce
Link to example (edit mode)
const [searchParams, setSearchParams] = useSearchParams({ option: 'One' });
searchParams.get('option')
. The value should change to the new valueExpected Behavior
The search params would be blank and
searchParam
would be an empty object-ish.Actual Behavior
searchParam
reverts tooption: 'One'
edited to include a working example of the bug and instructions Jan 23, 2023
The text was updated successfully, but these errors were encountered: