Skip to content

pbeshai/use-query-params

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b14c97e · Mar 24, 2023
Feb 8, 2023
Aug 31, 2022
Aug 31, 2022
Mar 24, 2023
Jul 25, 2022
Jul 25, 2022
Jul 25, 2022
Sep 13, 2019
May 1, 2021
Jul 25, 2022
Jul 27, 2022
Jul 25, 2022
Jul 25, 2022
Jul 25, 2022
Jul 25, 2022
Feb 8, 2023

Repository files navigation

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.

Package Version Docs Description
use-query-params npm use-query-params React library
serialize-query-params npm serialize-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