Top 10 React state libraries, sorted by downloads: 1
Top 10 React state libraries, sorted by downloads:
1. Redux (single store, typically with Redux Toolkit)
2. Apollo (for GraphQL - includes caching)
3. Zustand (Redux, simplified)
4. Tanstack query (For server/async state - includes caching)
5. swr (Tanstack query alternative)
6. Mobx (observables, actions, and derivations)
7. Jotai (State atoms. Recoil, simplified. A “drop-in” context replacement)
8. XState (For complex logic)
9. Recoil (State atoms. For highly dynamic UIs)
10. Valtio (Mobx, simplified to 2 APIs)
And here's what's weird about this list: I don't know whether to include routers.
For instance, @tan_stack router includes state management. It basically replaces Tanstack query if each page fetches unique data.
Routers handling state and caching makes a lot of sense to me.