Differentiate undefined and null in useRouteQuery #2914
Replies: 2 comments 1 reply
-
I'm also confused by this. How do you set a querystring parameter without a value? |
Beta Was this translation helpful? Give feedback.
1 reply
-
#3294 has been merged, so I think we can end the discussion here :) |
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.
-
I would like to differentiate these URLs:
/foo
/foo?q
/foo?q=bar
If I'm using
const route = useRoute()
that's possible;route.query.q === undefined
route.query.q === null
route.query.q === 'bar'
But with
const q = useRouteQuery('q')
there seems no differentiation betweenundefined
andnull
.q === null
q === null
q === 'bar'
Is that intentional? Did I miss an obvious solution?
Beta Was this translation helpful? Give feedback.
All reactions