pbeshai/use-query-params

React Hook for managing state in URL query parameters with easy serialization.

TypeScript

2,235

359 commits

updated Jan 21, 2026

See the code

README

useQueryParams

A React Hook, HOC, and Render Props solution for managing state in URL query parameters with easy serialization.

Works with React Router 5 and 6 out of the box. TypeScript supported.

npm Travis (.com)


When creating apps with easily shareable URLs, you often want to encode state as query parameters, but all query parameters must be encoded as strings. useQueryParams allows you to easily encode and decode data of any type as query parameters with smart memoization to prevent creating unnecessary duplicate objects. It uses serialize-query-params.

Docs

Packages

This is a monorepo managed with Lerna.

PackageVersionDocsDescription
use-query-paramsnpmuse-query-params React library
serialize-query-paramsnpmserialize-query-params js library

Development

To get running locally:

npm install
npx lerna bootstrap --hoist --scope "use-query-params" --scope "serialize-query-params"
npm build
npm test

Set up examples:

lerna bootstrap --scope "*-example"
lerna link

Then run one:

lerna run --scope react-router-example start
hooks
query
query-parameters
queryparams
querystring
react
react-hooks
reactjs
url

pbeshai/use-query-params

React Hook for managing state in URL query parameters with easy serialization.

TypeScript

2,235

359 commits

updated Jan 21, 2026

See the code

README

useQueryParams

A React Hook, HOC, and Render Props solution for managing state in URL query parameters with easy serialization.

Works with React Router 5 and 6 out of the box. TypeScript supported.

npm Travis (.com)


When creating apps with easily shareable URLs, you often want to encode state as query parameters, but all query parameters must be encoded as strings. useQueryParams allows you to easily encode and decode data of any type as query parameters with smart memoization to prevent creating unnecessary duplicate objects. It uses serialize-query-params.

Docs

Packages

This is a monorepo managed with Lerna.

PackageVersionDocsDescription
use-query-paramsnpmuse-query-params React library
serialize-query-paramsnpmserialize-query-params js library

Development

To get running locally:

npm install
npx lerna bootstrap --hoist --scope "use-query-params" --scope "serialize-query-params"
npm build
npm test

Set up examples:

lerna bootstrap --scope "*-example"
lerna link

Then run one:

lerna run --scope react-router-example start
hooks
query
query-parameters
queryparams
querystring
react
react-hooks
reactjs
url

Project health

Overall

2.5/10

Maintained

0/10

Code review

3/10
OpenSSF Scorecard

Latest release

2.2.2 · Nov 22, 2025

Releases this year

1

Significant stargazers

(top 24 of 26)

Erick Zhao

533 followers · starred Jun 2023

Marc Klingen

495 followers · starred Sep 2023

Lucas Azzola

370 followers · starred Oct 2020

lauren

7,617 followers · starred Mar 2019