# What changed in use-query-params

> 27 changes in use-query-params 1 to 2 from its official release notes, upgrade guides and advisories: 5 breaking, 15 new APIs and options. Each one cited. Sources checked 2026-10-25. HTML: https://unstale.sh/npm/use-query-params/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## use-query-params 2

### Breaking changes

- Pass an adapter to connect the routing library; the provider no longer takes React Router or Reach props. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- URLSearchParams replaces query-string as the default parser and stringifier; it does not support null values. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)

### New APIs and options

- Configure the stringifier used for objects, such as query-string’s stringify function. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Experimentally batch consecutive setQueryParams calls so they result in a single URL update. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Include all other parameters found in the current URL in addition to those specified. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Include all preconfigured QueryParamProvider parameters in addition to those specified. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Remove default values from the URL on updates; this requires a parameter default and does not apply on initial load. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Set the default update type used when set is called; the default is pushIn. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Register parameters with the provider so downstream hooks can use them; nested providers extend the registered parameter list. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Configure the parser used for search strings, such as query-string’s parse function. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Set a parameter’s URL name to automatically map it to a different name in the URL. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Deep import the React Router 5 adapter. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Deep import the React Router 6 adapter. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Call the hook with a registered parameter name to inherit its parameter type, or provide a parameter and options explicitly. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)
- Retrieve all provider-registered parameters, a selected subset, or explicitly supplied parameter definitions. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)

### Behavior and default changes

- Decoded values are cached across hook calls from different components. (2.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.0.0)

### Fixes and other changes

- Missing datetime exports were added. (2.2.2) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.2.2)
- The types of decodeQueryParams were fixed. (2.2.2) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.2.2)
- The types of encodeQueryParams were fixed. (2.2.2) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.2.2)
- WindowHistoryAdapter is notified when the page's URL is updated. (2.2.2) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/use-query-params%402.2.2)

## use-query-params 1

### Breaking changes

- The default update type changes from replaceIn to pushIn. (1.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/v1.0.0)
- 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.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/v1.0.0)
- Empty strings and null are now accepted as query parameter values; null may be decoded, so destructuring defaults no longer handle it. (1.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/v1.0.0)

### New APIs and options

- Wrap a query parameter with withDefault to provide a default value when decoded values may be null. (1.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/v1.0.0)
- A new HOC provides a mapToProps API similar to react-redux connect. (1.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/v1.0.0)

### Behavior and default changes

- The library warns in development when QueryParamProvider has not been added. (1.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/v1.0.0)

### Fixes and other changes

- Multiple updates in a single render are fixed. (1.0.0) — [release notes](https://github.com/pbeshai/use-query-params/releases/tag/v1.0.0)
