recoil vs @tanstack/react-query
@tanstack/react-query is downloaded 112.9× more often than recoil (225,327,948 vs 1,996,509 per month), so it has the larger community and more answered questions online. @tanstack/react-query ships 42% less gzipped JavaScript (13.3 kB vs 22.7 kB), which matters if bundle size is a priority. @tanstack/react-query has been updated more recently, a sign of more active maintenance.
| Metric | recoil | @tanstack/react-query |
|---|---|---|
| Weekly downloads | 442,833 | 51,850,189✓ |
| Monthly downloads | 1,996,509 | 225,327,948✓ |
| GitHub stars | 19,470 | 49,542✓ |
| Minified size | 74.2 kB | 45.1 kB✓ |
| Minified + gzipped | 22.7 kB | 13.3 kB✓ |
| Dependencies | 1 | 1 |
| Open issues | 320 | 172✓ |
| Last commit | 2025-01-01 | 2026-06-02✓ |
| Latest version | 0.7.7 | 5.100.14 |
| License | MIT | MIT |
When to choose which
recoil
Facebook's experimental atomic state library.
Choose it when: Avoid for new projects — it is effectively unmaintained. Jotai covers the same atomic model and is actively developed.
- + Atomic model
- + Async selectors
- - Effectively unmaintained
- - Larger than Jotai
@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 | recoil | @tanstack/react-query |
|---|---|---|
| Paradigm | Atoms | Async server cache |
| First-class TypeScript | Partial | ✓ Yes |
| Works outside React | ✗ No | Partial |
| Dedicated devtools | Limited | ✓ Yes |
| Built-in async / server state | ✓ Yes | ✓ Yes |
| Boilerplate | Medium | Low |
Related comparisons
Embed this comparison
A live badge for your README — it updates as the numbers change.
[](https://devcompare.dev/compare/recoil-vs-tanstack-react-query)Data from npm, Bundlephobia and GitHub. Last updated 2026-06-02.