Skip to content

Releases: pbeshai/use-query-params

v1.1.7

14 Sep 15:53
Compare
Choose a tag to compare
  • More careful caching of param configs via #121 #122

v1.1.6

13 Jul 16:45
Compare
Choose a tag to compare
  • Fixes bug where functional updates were broken when the value needed to be encoded #116 #117

v1.1.5

29 Jun 15:20
Compare
Choose a tag to compare
  • Fixes #113 bug where if the query config changed, things would break due to caching

v1.1.4

17 Jun 19:03
Compare
Choose a tag to compare
  • Fixes a bug where withDefault didn't work with DateParams #111

v1.1.3

06 May 18:32
Compare
Choose a tag to compare
  • Fixes problem where dates didn't update properly due to shallowEqual not working on them. Solution is to support an equals field on parameters (updated DateParam and DateTimeParam accordingly). #100

v1.1.2

29 Apr 22:37
Compare
Choose a tag to compare
  • Fixes a bug where location would be stale on first useEffect after a page transition #95

v1.1.1

21 Apr 01:04
Compare
Choose a tag to compare
  • Resolves #91 to improve withDefault typing with useQueryParam

v1.1.0

17 Apr 18:10
Compare
Choose a tag to compare
  • Adds new stringifyOptions prop to QueryParamProvider to allow passing options to stringify #23
  • Adds support for functional updates e.g. setQuery(latestQuery => ({ newValue: 123 + latestQuery.newValue }) #26

v1.0.0

17 Apr 04:13
Compare
Choose a tag to compare

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

10 Jan 22:25
Compare
Choose a tag to compare
  • 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 as foo- and deserialize to { foo: '' }. Previously empty string values were discarded and foo- would be deserialized to {foo: undefined }