nuqs
@nuqs.dev
290 followers 1 following 65 posts
Type-safe search params state manager for React frameworks. Like useState, but stored in the URL query string. Made by @francoisbest.com & contributors 🔗 https://nuqs.dev
Posts Media Videos Starter Packs
Pinned
nuqs.dev
nuqs @nuqs.dev · Sep 6
🔗 Introducing our new domain name: nuqs.dev

2 years ago, I restarted work on the useQueryState hook to support the @nextjs.org app router.

Since then, the project exploded:
⭐ +8k stars
📦 +30M downloads
👥 +50 contributors
🩷 +23 sponsors

Thank you, everyone! 🫶
nuqs.dev
Drop the 47ng. Just nuqs. It's cleaner.
nuqs.dev
nuqs @nuqs.dev · 2d
📦 [email protected] is out! 🚀

Two rapid-fire PRs by @tkdodo.eu 🔥

- Fixed a bug with MultiParsers & history: push
- Prevent a re-render when doing setState(x => x) (same reference) in useQueryStates

Try it out: pnpm add nuqs@latest
npm i, {pnpm,yarn,bun} add nuqs@latest
nuqs.dev
nuqs @nuqs.dev · 8d
📦 [email protected] is out! 🚀

- MultiParsers: `parseAsNativeArrayOf`, and turn key repetition into Record, Map, Set, anything, with custom parsers. Thanks @tkdodo.eu ! 🙌

- Fixed a bug with flickering optimistic state on update

Try it out: pnpm add nuqs@latest
import { useQueryState, parseAsNativeArrayOf, parseAsInteger } from 'nuqs'

const [projectIds, setProjectIds] = useQueryState(
  'project',
  parseAsNativeArrayOf(parseAsInteger)
)

// ?project=123&project=456 → [123, 456]

Demo:
?nativeArray=123&nativeArray=456&nativeArray=789
[123,456,789]
nuqs.dev
nuqs @nuqs.dev · 12d
📦 [email protected] is out! 🚀

✨ MultiParsers allow transforming repeated keys in the URL into more complex data types. This had been a long-requested one, thanks @tkdodo.eu! 🫶

🧪 The testing adapter gets an optional memory to behave more closely to real frameworks.

Try it out: pnpm add nuqs@beta
feat: multi-parsers #1134
PR by TkDodo

MultiParsers allow **key repetition** in the URL.

E.g.: with the built-in `parseAsNativeArrayOf`:
```ts
const [state] = useQueryState('key', parseAsNativeArrayOf(parseAsInteger))
// url:   /?key=1&key=2&key=3
// state: [1, 2, 3]
```

Creating custom multi-parsers allow reducing the array of query values into more complex objects:
```ts
// /?kv=foo:bar&kv=baz:qux
{
  foo: 'bar',
  baz: 'qux'
}
```
Reposted by nuqs
bejs.bsky.social
Relive the brilliance of #ReactParis 2025! 🌟

Catch up on last conf's unforgettable sessions:
➡️ Type Safe URL State Management in #React with nuqs -by- @francoisbest.com
🎞️ www.youtube.com/watch?v=U__R...

😉 See you next March 2026 👉🏽 react.paris
Type Safe URL State Management in React with nuqs - François Best
YouTube video by BeJS
www.youtube.com
Reposted by nuqs
francoisbest.com
@nuqs.dev v3 will likely require @react.dev 19.

We managed to work around not using `useOptimistic` with hacks, but to properly support optimistic local state updates while the URL update is queued, with concurrent rendering & Suspense, we need to do it the right way.
Reposted by nuqs
francoisbest.com
I need to get better at SEO.

A lot of folks can't remember the name `nuqs`, but know what it's about, and can't find it with search terms.

Neither the docs, the GitHub repo, nor the NPM package page rank for some critical keywords.
Why on Earth did the developers name the library like so. It does not show up with a "query params state react" search query on Google. I found that library from a goddamn Reddit comment.
Reposted by nuqs
Reposted by nuqs
tkdodo.eu
Proud to have contributed this feature to @nuqs.dev ❤️
nuqs.dev
nuqs @nuqs.dev · 19d
You can change this default globally at the adapter level if it makes more sense in your case:
nuqs • Send all URL updates to the server

<NuqsAdapter defaultOptions={{ shallow: false }}>
  {children}
</NuqsAdapter>
nuqs.dev
nuqs @nuqs.dev · 19d
You can change this default globally at the adapter level if it makes more sense in your case:
nuqs • Send all URL updates to the server

<NuqsAdapter defaultOptions={{ shallow: false }}>
  {children}
</NuqsAdapter>
nuqs.dev
nuqs @nuqs.dev · 19d
Why do nuqs URL updates occur client-side only by default?

Because you're guaranteed to run @react.dev on the client, but not all frameworks do SSR.

With `shallow: false`, you opt-out of this client-only behaviour, and cross the network boundary for search params you need during SSR.
nuqs.dev
nuqs @nuqs.dev · 22d
Imagine a local-first, distributed, peer-to-peer, immutable data exchange system.

This is not BitTorrent.

It’s what you get from putting your app state in the URL.
Reposted by nuqs
francoisbest.com
🗣️ Big news: I'll be speaking at @nextjs.org Conf '25, on Oct 22 in SF !

We'll cover a few tricks @nuqs.dev has up its sleeve to scale URL state in Next.js (some I yet need to finish building 😅).

So thankful for the opportunity 🙌
Next.js Conf 25
Featured Speakers
Focused on François Best
Other speakers include: Guillermo Rauch, Lydia Hallie, Aileen Villaneuva, Ryan Vogel, Ankita Kulkarni and Aurora Scharff
Reposted by nuqs
francoisbest.com
New section in the @nuqs.dev landing page.

A huge thank you to all these wonderful people 🫶
Contributors
A grid of avatars
nuqs.dev
nuqs @nuqs.dev · Sep 6
🔗 Introducing our new domain name: nuqs.dev

2 years ago, I restarted work on the useQueryState hook to support the @nextjs.org app router.

Since then, the project exploded:
⭐ +8k stars
📦 +30M downloads
👥 +50 contributors
🩷 +23 sponsors

Thank you, everyone! 🫶
nuqs.dev
Drop the 47ng. Just nuqs. It's cleaner.
nuqs.dev
nuqs @nuqs.dev · Sep 5
The next release will have a major change.

Not breaking, and not in code.

Stay tuned 👀
nuqs.dev
nuqs @nuqs.dev · Sep 5
📦 [email protected] is out! 🚀

- ✨ `processUrlSearchParams` middleware: sort the querystring alphabetically (for SEO & cache) or process it before updating the URL.
- 💎 Zod codecs community parser
- ⚠️ Log a warning when using debounce with shallow: true with a link to docs

Try it out: pnpm add nuqs@latest
{npm i, {pnpm,yarn,bun} add} nuqs@latest
Reposted by nuqs
brockherion.bsky.social
Absolutely love Nuqs. I don’t leave home without it!
Reposted by nuqs
Reposted by nuqs
devtools.fm
How far can you get with URL state management?

Find our with out latest guest @francoisbest.com creator of NUQS

www.youtube.com/watch?v=2x5B...
creators.spotify.com/pod/profile/...
Reposted by nuqs
francoisbest.com
In the next version of @nuqs.47ng.com: the adapters get a middleware 🔌

- Process URLSearchParams as you wish
- Examples: sort alphabetically, add versioning, etc

I'm still not a big fan of the whole URL shifting around on updates, but a lot of folks have asked for stable ordering (for caching).
Reposted by nuqs
johnnyreilly.com
A long time ago I wrote a rudimentary post on storing state in URLs: johnnyreilly.com/react-usesea... - at the time I thought there was much more that could be done... And it looks like @nuqs.47ng.com has done it!
Reposted by nuqs
francoisbest.com
Is there a tool that, given a set of .d.ts files, gives you the minimum version of TypeScript supported?

TIL @nuqs.47ng.com requires TS ^5, and that requirement came in silently as a feature was merged (const modifiers on generics).

I need to automate this to prevent further type breaking changes.
nuqs.dev
nuqs @nuqs.dev · Aug 30
📦 [email protected] is out! 🚀

It fixes a referential stability issue with the testing adapter. The state updater function is now stable across renders & state updates in test environments (@vitest.dev, Jest etc)

Try it out: pnpm add nuqs@latest
install nuqs@latest
Reposted by nuqs
sebastienlorber.com
This Week In React 247

🍿 Read and subscribe!
thisweekinreact.com/newsletter/247

⚛️ React
- nuqs
- Concurrent React
- Apollo
- shadcn CLI
- Fragment Refs
- Streamdown
- Waku
- React-Aria
📱 RN
- Expo Launch
- Maestro
- SPM
- Screens
- BottomSheet
- Jest
Reposted by nuqs
francoisbest.com
🎥 New video: how to use Zod codecs with nuqs 👀

- ⚡️ Type-safe input (string-based) and output schemas
- ☑️ Validation on write
- 🪶 Super lightweight
Using Zod codecs with nuqs
YouTube video by 47ng
m.youtube.com