返回排行榜
React Hook for managing state in URL query parameters with easy serialization.
reactreactjshooksreact-hooksurlqueryqueryparamsquery-parametersquerystring
关键指标
Star 增长趋势
Star
2.2k
Forks
99
周增长
—
Issues
36
5001k1.5k2k
2019年3月2020年5月2021年8月2022年11月2024年2月2025年4月2026年7月
制品库npm
npm install use-query-paramsREADME
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.
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 |
use-query-params React library | ||
serialize-query-params |
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
相关仓库