Is there a way to clear all other query parameters when adding another one? #1030
Answered
by
Serpentarius13
Serpentarius13
asked this question in
Q&A
-
I have a case where I switch the "view" param to show different screens, with each one having their own filters managed by nuqs. I want to remove all these parameters when I switch away from view to view. Is there a way to clear all other parameters when calling "setValue" from view's useQueryState? |
Beta Was this translation helpful? Give feedback.
Answered by
Serpentarius13
Jul 1, 2025
Replies: 1 comment 2 replies
-
See #684. If you want to clear all search params, this is a navigation: use the router methods (push or replace) to navigate to the desired pathname without any search params. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, thanks, I went with useNavigate(useLocation().pathname) approach. Would be nice to have something built-in though, as nuqs controls those parameters in its own container, right?