Skip to content

UseTransitions with useQueryStates() #509

Closed Answered by franky47
Jbenzs asked this question in Q&A
Discussion options

You must be logged in to vote

In useQueryStates, the options are passed not per-parser, but at the global level in a second parameter, so this should work:

const [pagination, setPagination] = useQueryStates(
  {
    page: parseAsInteger,
    pageSize: parseAsInteger
  },
  {
    // Options go here
    startTransition
  }
)

It's a bit confusing though, since there would be three places to define options (per parser with .withOptions, in the second parameter to apply to all keys, and at the call level). Not sure what the proper override order should be between the first two. Probably (in order of precedence) call level, then parser level, then hook level, then defaults.

Most of the time, setting an option will apply to …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Jbenzs
Comment options

You must be logged in to vote
0 replies
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