nuqs (@nuqs47ng) 's Twitter Profile
nuqs

@nuqs47ng

Type-safe search params state manager for React frameworks.
Like useState, but stored in the URL query string.

Made by @fortysevenfx & contributors

ID: 1825628597614190592

linkhttps://nuqs.47ng.com calendar_today19-08-2024 20:19:20

561 Tweet

2,2K Followers

40 Following

nuqs (@nuqs47ng) 's Twitter Profile Photo

Mianala Expo TL;DW: nuqs loads in Expo 53, I have a PoC with the tabs example where it stores useQueryState in the search params, but this is where my understanding of Expo Router falls short. Feels like each app tab is like a browser tab with its own URL?

nuqs (@nuqs47ng) 's Twitter Profile Photo

One-tweet guide to the `shallow` option in nuqs: • Using RSC / SSR / loaders? → set `shallow: false` to notify the server of updates. • Using SPA / CSR and client-side fetching (eg: TANSTACK Query or SWR) ? → Keep `shallow: true` (the default) for local-only updates.

One-tweet guide to the `shallow` option in nuqs:

• Using RSC / SSR / loaders? → set `shallow: false` to notify the server of updates.

• Using SPA / CSR and client-side fetching (eg: <a href="/tan_stack/">TANSTACK</a> Query or SWR) ? → Keep `shallow: true` (the default) for local-only updates.
nuqs (@nuqs47ng) 's Twitter Profile Photo

📦 In the next version of nuqs: Loaders get a strict mode option, that throws errors on *invalid* search param values, rather than falling back to the default value. Will land in the next beta today along with Standard Schema support. 👀

📦 In the next version of nuqs:

Loaders get a strict mode option, that throws errors on *invalid* search param values, rather than falling back to the default value.

Will land in the next beta today along with Standard Schema support. 👀
nuqs (@nuqs47ng) 's Twitter Profile Photo

📦 [email protected] is out! 🚀 It adds a couple of features: - Standard Schema generation: validate & infer types with other tools (tRPC, TanStack Router), using existing search params definitions - Strict mode for loaders & cache (see QT) Try it out: pnpm add nuqs@beta

📦 nuqs@2.5.0-beta.2 is out! 🚀

It adds a couple of features:

- Standard Schema generation: validate &amp; infer types with other tools (tRPC, TanStack Router), using existing search params definitions
- Strict mode for loaders &amp; cache (see QT)

Try it out: pnpm add nuqs@beta
nuqs (@nuqs47ng) 's Twitter Profile Photo

Weekend project: adding validation ✅ - Deserialise → parse → validate on read - No validation on write yet (would be a breaking change, could be an experimental opt-in flag) - Standard Schema based, or pass in any sync function that throws on invalid values (for other libs)

Weekend project: adding validation ✅

- Deserialise → parse → validate on read
- No validation on write yet (would be a breaking change, could be an experimental opt-in flag)
- Standard Schema based, or pass in any sync function that throws on invalid values (for other libs)
nuqs (@nuqs47ng) 's Twitter Profile Photo

🗣️ Talk alert! I'll be speaking about nuqs at React Advanced Conference London on November 28th / Dec 1st 🙌 Looking forward to meeting y'all there IRL or online (click on my badge to watch the livestream for free): gitnation.com/badges/react-a…

React Advanced London (@reactadvanced) 's Twitter Profile Photo

🚀 The URL is a powerful yet overlooked state manager. nuqs introduces nuqs, a library that simplifies managing state through URLs in React apps. 🌐 Discover how to make your app’s state shareable, type-safe, and scalable with declarative client-server interaction.

Darius Cosden 🧑🏻‍💻 (@dariuscosden) 's Twitter Profile Photo

The best library for URL state in React is nuqs It provides clean and simple hooks that look just like useState but sync automatically with the URL Here's how to use it

The best library for URL state in React is nuqs

It provides clean and simple hooks that look just like useState but sync automatically with the URL

Here's how to use it