React Hook for managing state in URL query parameters with easy serialization.
equals
field on parameters (updated DateParam and DateTimeParam accordingly). #100withDefault
typing with useQueryParamstringifyOptions
prop to QueryParamProvider to allow passing options to stringify #23setQuery(latestQuery => ({ newValue: 123 + latestQuery.newValue })
#26Updates to serialize-query-params v1.0.1
foo = null
-> ?foo
, foo = ''
-> ?foo=
, foo = undefined
-> ?
(removes if present--this was current behavior)const { foo = [] } = query
won't work when foo = null). To get around this, a withDefault helper has been added.useQueryParams({ foo: withDefault(ArrayParam, []) })
#76 Switches default update type from replaceIn to pushIn
{ foo: '' }
will now serialize as foo-
and deserialize to { foo: '' }
. Previously empty string values were discarded and foo-
would be deserialized to {foo: undefined }