Support undefined as a default value in Parsers
#595
Unanswered
taylorjohnwood
asked this question in
Ideas
Replies: 1 comment 2 replies
|
You could wrap your useQueryState hook to get this behaviour: function useUndefinedQueryState() {
const [state, setState] = useQueryState('my-key')
return [state ?? undefined, setState] as const
}You would still have to set the value to If you want to try your hand at a PR, the hardest part will be updating the type definitions, and the |
2 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.
For better or worse, some applications have a strict semantic difference between
nullandundefined. Would it be possible to supportundefinedas a default for parsers?e.g
I'm happy to raise a PR for this if people agree it belongs in Nuqs!
All reactions