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 |
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
-
For better or worse, some applications have a strict semantic difference between
null
andundefined
. Would it be possible to supportundefined
as a default for parsers?e.g
I'm happy to raise a PR for this if people agree it belongs in Nuqs!
Beta Was this translation helpful? Give feedback.
All reactions