47ng / nuqs

Type-safe search params state manager for React frameworks - Like useState, but stored in the URL query string.
https://nuqs.47ng.com
MIT License
4.86k stars 104 forks source link

feat: Allow the `serialize` function in parsers to remove their key from the URL #770

Closed franky47 closed 3 days ago

franky47 commented 6 days ago

Returning null from the serialize function signals that the associated search param should be removed from the URL.

This would allow clearing invalid states passed to the serialize function.

Edit: this would actually count as a breaking change (the docs did break), so it will be added to the v3 release line.

Tasks

See related discussion.

vercel[bot] commented 6 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuqs ❌ Failed (Inspect) Nov 16, 2024 0:00am
pkg-pr-new[bot] commented 6 days ago

Open in Stackblitz

pnpm add https://pkg.pr.new/nuqs@770

commit: 6d6d930

franky47 commented 3 days ago

Closing for now, to be reopened for v3.