pbeshai / use-query-params

React Hook for managing state in URL query parameters with easy serialization.
https://pbeshai.github.io/use-query-params
ISC License
2.13k stars 95 forks source link

Request: Add option to store array params as comma-separated list #285

Open nico-martinucci opened 5 months ago

nico-martinucci commented 5 months ago

There seem to generally be two accepted methods of storing arrays in params:

?foo=bar&foo=qux

...and...

?foo=bar,qux

This library currently uses the former, but other backend filtering libraries assume params will becoming in formatted like the latter. Would be great to have either a different param type or some sort of option to store array params in the latter format for this purpose.

pbeshai commented 5 months ago

Try using DelimitedArrayParam for this use case