set(null) does not consistently remove multiple query states from the URL #1231
Unanswered
Gustavo-Wippel
asked this question in
Q&A
Replies: 1 comment
-
|
Thanks, I don't see a setState(null) in your example, would you be able to open an issue with a minimal reproduction please? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I’m facing an issue when clearing multiple Nuqs query states.
When calling set(null) to reset all filters, some values are removed successfully — but others remain in the URL, even though they should be cleared.
Example
Before clearing filters:
?situacao=CONFERENCIA%2CAPROVACAO&periodoCriacao=2025-11-03_2025-11-05After calling set(null) on all query states:
?situacao=CONFERENCIA%2CAPROVACAOperiodoCriacao is cleared correctly, but situacao stays in the URL.
This does not happen only with situacao — this behavior can affect any filter, depending on the moment the cleanup happens.
Expected behavior
Calling set(null) for each query state should remove all corresponding query parameters.
After clearing, the URL should be empty or contain only the filters still intentionally set.
Actual behavior
Some filters are removed while others remain.
Inconsistent result when clearing multiple query states at once.
My Nuqs Context:
Function that clear URL Values:
I’d like to know if this is expected behavior (batching, sync timing, ordering) or if it might be a bug when resetting multiple states simultaneously.
Beta Was this translation helpful? Give feedback.
All reactions