Context
What's your version of nuqs
?
What framework are you using?
- ❌ Next.js (app router)
- ❌ Next.js (pages router)
- ❌ React SPA (no router)
- ❌ Remix
- ✅ React Router
- ❌ Other (please specify)
Which version of your framework are you using?
"react": "^19.0.0",
"react-router": "^7.5.2",
Description
When initializing query state boolean to true
(useQueryState("bool", parseAsBoolean.withDefault(true))
), setting value to false
(setBool(false)
) will update the url params bool=false
, and won't when setting it to true (empty url params). The behavior is inverted, it should update the url for true
, not false
.
Expected: When default boolean query state to true
, it should update the url with the query param.
Reproduction
Cannot provide reproduction, because on stackblitz, it seems it doesn't update the URL when setting query state. (https://stackblitz.com/edit/vitejs-vite-qp7k4iak)