Type-safe search params state manager for Next.js - Like React.useState, but stored in the URL query string.
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] 11 months ago
An internal Next.js app router change (https://github.com/vercel/next.js/pull/56497) causes prefetch links to reset shallow URL updates on hover or mount. It was introduced between [email protected]
(last known working version) and [email protected]
, then released on stable in [email protected]
.
Consequently, next-usequerystate
is marked as being incompatible with the latest Next.js versions until I have identified the root cause, and a fixing PR is merged and released.
Published by github-actions[bot] 11 months ago
Published by github-actions[bot] 12 months ago
Full Changelog: https://github.com/47ng/next-usequerystate/compare/v1.9.2...v1.10.0
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Full Changelog: https://github.com/47ng/next-usequerystate/compare/v1.9.1...v1.9.2
Published by github-actions[bot] 12 months ago
Full Changelog: https://github.com/47ng/next-usequerystate/compare/v1.9.0...v1.9.1
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] 12 months ago
Published by github-actions[bot] about 1 year ago
Full Changelog: https://github.com/47ng/next-usequerystate/compare/v1.8.3...v1.8.4
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
Announcement blog post: https://francoisbest.com/posts/2023/storing-react-state-in-the-url-with-nextjs
This release brings support for the app
router, and requires Next.js 13.4+.
It is a complete internal rewrite, that gives us:
React.useState
)Refer to the documentation for more details.
Query updates are using the following defaults, that changed from the previous version:
scroll: false
shallow: true
Read the options documentation to configure those behaviours.
The queryTypes
parser bag is marked as deprecated, as it wasn't tree-shakeable. It is replaced by individual parsers.
- import { useQueryState, queryTypes } from 'next-usequerystate'
+ import { useQueryState, parseAsInteger } from 'next-usequerystate'
- useQueryState('counter', queryTypes.integer.withDefault(0))
+ useQueryState('counter', parseAsInteger.withDefault(0))
Some internal type definitions have been renamed for consistency across the codebase.
Since they were exported, the change is retro-compatible with deprecation notices on the old type names.
Those deprecated exports will be removed in the next major version (2.0.0).
A big thanks to all who have helped testing the beta versions, and especially:
Full Changelog: https://github.com/47ng/next-usequerystate/compare/v1.7.3...v1.8.0
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago