Skip to content
Discussion options

You must be logged in to vote

What should happen if a user clicked on a link that said ?service=swap, before the set of valid values is known? Or what should happen if they click on an invalid link ?service=banana?

One way would be to feed the promise to use and let the component suspend while it's pending, then you'd get the set of values to feed to the parser.

Parsers should be pure functions, side-effect free, and synchronous. Moreover, all useQueryState(s) hooks should have the same parser for a given key, see https://nuqs.dev/docs/troubleshooting#different-parsers-on-the-same-key.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nikitayutanov
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
Q&A
Labels
None yet
2 participants