Skip to content
Discussion options

You must be logged in to vote

What I can see is that your keys are dynamic: they contain the name of the final key in the resulting object. Assuming you can enumerate the properties you want to support in that object, you could do something like this:

  1. Turn that list of properties into a descriptor of parsers to use (they will need to have all the same type, so if you have multiple data types you could split those into separate hooks, each aggregating properties of the same type)
  2. Use the urlKeys feature to remap those logical property names into dynamic keys in the url, by adding the filter[${property}] format
  3. Feed that to useQueryStates

Example:

import {
  parseAsString,
  useQueryStates,
  type ParserBuilder,
  type 

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ForeshadowRU
Comment options

@franky47
Comment options

Answer selected by ForeshadowRU
@ForeshadowRU
Comment options

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