Releases: pbeshai/use-query-params
Releases · pbeshai/use-query-params
v1.1.7
v1.1.6
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.0
Breaking Changes
-
Updates to serialize-query-params v1.0.1
- #73 #49 #79
- This changes how empty strings and null are handled. Previously they were auto filtered out / became undefined, but now they are accepted as possible values.
foo = null
->?foo
,foo = ''
->?foo=
,foo = undefined
->?
(removes if present--this was current behavior) - This means values may be decoded as null, which breaks how you may normally provide default values (
const { foo = [] } = query
won't work when foo = null). To get around this, a withDefault helper has been added. - To provide a default value, wrap your param with withDefault. e.g.
useQueryParams({ foo: withDefault(ArrayParam, []) })
- query-string is no longer directly exported or depended on. It is now a peer dependency, v5.1.1 or v6 will work, you decide what you use.
-
#76 Switches default update type from replaceIn to pushIn
New Features
- #62 multiple updates in a single render has been fixed thanks to @dprgarner's reworking of how locations passed around internally (see #84, #86)
- #69 new HOC withQueryParamsMapped has been added that provides a mapToProps API similar to react-redux connect
- #82 Warns in dev if you forgot to add QueryParamProvider
v0.6.0
- Possibly breaking Updates serialize-query-params to 0.3.0 which now allows empty strings to be valid values in objects. For example:
{ foo: '' }
will now serialize asfoo-
and deserialize to{ foo: '' }
. Previously empty string values were discarded andfoo-
would be deserialized to{foo: undefined }