unstale

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 init

@unstale/cli 0.2.6 on npm

use-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.

    2.0.0release notes

  • URLSearchParams replaces query-string as the default parser and stringifier; it does not support null values.

    2.0.0release notes

New APIs and options 13

  • Configure the stringifier used for objects, such as query-string’s stringify function.

    2.0.0release notes

  • Experimentally batch consecutive setQueryParams calls so they result in a single URL update.

    2.0.0release notes

  • Include all other parameters found in the current URL in addition to those specified.

    2.0.0release notes

  • Include all preconfigured QueryParamProvider parameters in addition to those specified.

    2.0.0release notes

  • Remove default values from the URL on updates; this requires a parameter default and does not apply on initial load.

    2.0.0release notes

  • Set the default update type used when set is called; the default is pushIn.

    2.0.0release notes

  • Register parameters with the provider so downstream hooks can use them; nested providers extend the registered parameter list.

    2.0.0release notes

  • Configure the parser used for search strings, such as query-string’s parse function.

    2.0.0release notes

  • Set a parameter’s URL name to automatically map it to a different name in the URL.

    2.0.0release notes

  • Deep import the React Router 5 adapter.

    2.0.0release notes

  • Deep import the React Router 6 adapter.

    2.0.0release notes

  • Call the hook with a registered parameter name to inherit its parameter type, or provide a parameter and options explicitly.

    2.0.0release notes

  • Retrieve all provider-registered parameters, a selected subset, or explicitly supplied parameter definitions.

    2.0.0release notes

Behavior and default changes 1

  • Decoded values are cached across hook calls from different components.

    2.0.0release notes

Fixes and other changes 4

use-query-params 17 changes

Breaking changes 3

  • The default update type changes from replaceIn to pushIn.

    1.0.0release notes

  • query-string is no longer directly exported or depended on; applications must choose it as a peer dependency, using v5.1.1 or v6.

    1.0.0release notes

  • Empty strings and null are now accepted as query parameter values; null may be decoded, so destructuring defaults no longer handle it.

    1.0.0release notes

New APIs and options 2

  • Wrap a query parameter with withDefault to provide a default value when decoded values may be null.

    1.0.0release notes

  • A new HOC provides a mapToProps API similar to react-redux connect.

    1.0.0release notes

Behavior and default changes 1

  • The library warns in development when QueryParamProvider has not been added.

    1.0.0release notes

Fixes and other changes 1