nanostores vs @tanstack/react-query
@tanstack/react-query is downloaded 14.5× more often than nanostores (225,327,948 vs 15,511,236 per month), so it has the larger community and more answered questions online. nanostores ships 85% less gzipped JavaScript (2.0 kB vs 13.3 kB), which matters if bundle size is a priority. Both projects are actively maintained.
| Metric | nanostores | @tanstack/react-query |
|---|---|---|
| Weekly downloads | 3,974,543 | 51,850,189✓ |
| Monthly downloads | 15,511,236 | 225,327,948✓ |
| GitHub stars | 7,408 | 49,542✓ |
| Minified size | 4.5 kB✓ | 45.1 kB |
| Minified + gzipped | 2.0 kB✓ | 13.3 kB |
| Dependencies | 0✓ | 1 |
| Open issues | 24✓ | 172 |
| Last commit | 2026-04-30 | 2026-06-02✓ |
| Latest version | 1.3.0 | 5.100.14 |
| License | MIT | MIT |
When to choose which
nanostores
Tiny (<1 kB) atomic state shared across frameworks.
Choose it when: Shared state across React/Vue/Svelte/Solid, micro-frontends, or when every byte counts.
- + Smallest footprint
- + Cross-framework
- + Simple
- - Minimal feature set
- - Less suited to very large apps
@tanstack/react-query
Async server-state: caching, refetching and mutations.
Choose it when: Managing data from an API — caching, background refetch, pagination, mutations. It complements (not replaces) a client store.
- + Best-in-class server cache
- + Great devtools
- + Handles refetch/stale data
- - Not for client/UI state
- - More config than SWR
Feature comparison
| Feature | nanostores | @tanstack/react-query |
|---|---|---|
| Paradigm | Atoms (tiny) | Async server cache |
| First-class TypeScript | ✓ Yes | ✓ Yes |
| Works outside React | ✓ Yes | Partial |
| Dedicated devtools | ✓ Yes | ✓ Yes |
| Built-in async / server state | Manual | ✓ Yes |
| Boilerplate | Low | Low |
nanostores
A tiny (294 bytes) state manager for React/Preact/Vue/Svelte with many atomic tree-shakable stores
Related comparisons
Embed this comparison
A live badge for your README — it updates as the numbers change.
[](https://devcompare.dev/compare/nanostores-vs-tanstack-react-query)Data from npm, Bundlephobia and GitHub. Last updated 2026-06-02.