Skip to content
Discussion options

You must be logged in to vote

I was sure we already had a discussion about this topic, but it must have been on another platform.

TL;DR: no, the URL is the source of truth, so an initial value doesn't make sense: the value is whatever the URL contains (or doesn't contain, and therefore returns null or falls back to the default value if specified).

You can skip the default value and have the hook return null when there is no query in the URL, but if your use-case warrants that a given value in the URL explicitly maps to null, then nuqs isn't able to do that.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@vastamaki
Comment options

@franky47
Comment options

@vastamaki
Comment options

@franky47
Comment options

Answer selected by franky47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants