npm / use-query-params
use-query-params
What changed in use-query-params 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
5 breaking15 new APIs and options2 behavior and defaults5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inituse-query-params 220 changes
Breaking changes 2
Pass an adapter to connect the routing library; the provider no longer takes React Router or Reach props.
URLSearchParams replaces query-string as the default parser and stringifier; it does not support null values.
New APIs and options 13
Configure the stringifier used for objects, such as query-string’s stringify function.
Experimentally batch consecutive setQueryParams calls so they result in a single URL update.
Include all other parameters found in the current URL in addition to those specified.
Include all preconfigured QueryParamProvider parameters in addition to those specified.
Remove default values from the URL on updates; this requires a parameter default and does not apply on initial load.
Set the default update type used when set is called; the default is pushIn.
Register parameters with the provider so downstream hooks can use them; nested providers extend the registered parameter list.
Configure the parser used for search strings, such as query-string’s parse function.
Set a parameter’s URL name to automatically map it to a different name in the URL.
Deep import the React Router 5 adapter.
Deep import the React Router 6 adapter.
Call the hook with a registered parameter name to inherit its parameter type, or provide a parameter and options explicitly.
Retrieve all provider-registered parameters, a selected subset, or explicitly supplied parameter definitions.
Behavior and default changes 1
Decoded values are cached across hook calls from different components.
Fixes and other changes 4
Missing datetime exports were added.
The types of decodeQueryParams were fixed.
The types of encodeQueryParams were fixed.
WindowHistoryAdapter is notified when the page's URL is updated.
use-query-params 17 changes
Breaking changes 3
The default update type changes from replaceIn to pushIn.
query-string is no longer directly exported or depended on; applications must choose it as a peer dependency, using v5.1.1 or v6.
Empty strings and null are now accepted as query parameter values; null may be decoded, so destructuring defaults no longer handle it.
New APIs and options 2
Wrap a query parameter with withDefault to provide a default value when decoded values may be null.
A new HOC provides a mapToProps API similar to react-redux connect.
Behavior and default changes 1
The library warns in development when QueryParamProvider has not been added.
Fixes and other changes 1
Multiple updates in a single render are fixed.