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.

Metricrecoil@tanstack/react-query
Weekly downloads442,83351,850,189
Monthly downloads1,996,509225,327,948
GitHub stars19,47049,542
Minified size74.2 kB45.1 kB
Minified + gzipped22.7 kB13.3 kB
Dependencies11
Open issues320172
Last commit2025-01-012026-06-02
Latest version0.7.75.100.14
LicenseMITMIT

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

Featurerecoil@tanstack/react-query
ParadigmAtomsAsync server cache
First-class TypeScriptPartial✓ Yes
Works outside React✗ NoPartial
Dedicated devtoolsLimited✓ Yes
Built-in async / server state✓ Yes✓ Yes
BoilerplateMediumLow

recoil

Recoil - A state management library for React

@tanstack/react-query

Hooks for managing, caching and syncing asynchronous and remote data in React

Related comparisons

Embed this comparison

A live badge for your README — it updates as the numbers change.

recoil vs @tanstack/react-query downloads
[![recoil vs @tanstack/react-query](https://devcompare.dev/badge/recoil-vs-tanstack-react-query.svg)](https://devcompare.dev/compare/recoil-vs-tanstack-react-query)

Data from npm, Bundlephobia and GitHub. Last updated 2026-06-02.