Replies: 1 comment 2 replies
|
One approach to handle this situation is to create a custom parser function that can dynamically identify and process URL keys starting with custom_. This function can iterate through all search parameters, filter out the ones that match the custom_ prefix, and then parse them into a structured object. Here is a basic example of how you might implement such a function: This way, you can keep your URL structure clean and avoid creating an overly large useQueryStates object. You can then use the customParams object as needed in your application. |
2 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.
Today we have the case of parsing a dynamic group of url keys. All dynamic url keys begin with the same string (say
custom_).since
createParserdeals with only 1 value in both parser and serialize i will either have to make a HUGE useQueryStates object with every listable dynamic url key, or decide to store all dynamic values within one string such ascustom=key:val,key2:val2etcIf there was a way to get all the search Params and let me parse the ones I want and return a group i could still have a
key=val&key2=val2without having to put the whole thing in 1 valueAll reactions