// the find
pmndrs/jotai
👻 Primitive and flexible state management for React
Jotai is a bottom-up atomic state management library for React, heavily inspired by Recoil but with a smaller API surface and no string keys. Atoms are plain JS values; derived atoms are just functions over other atoms. Good fit for apps where global state is scattered across features rather than centralized in one big store.
The core is genuinely tiny (2kb) and the mental model transfers directly — if you understand useState and useMemo, you understand 80% of Jotai. Derived atoms with async support work well for data-fetching patterns without needing a separate cache layer. The vanilla store API (src/vanilla/store.ts) lets you read/write atoms outside React, which is useful for testing and non-React integrations. The ecosystem extensions (query, immer, xstate, zustand interop) are real and maintained, not just stubs.
Async atoms require Suspense, which is still painful to use correctly in production — error boundaries, streaming SSR, and Suspense interact in ways that will surprise you. The atomFamily pattern is a footgun: every unique key creates a new atom permanently, and there's no built-in GC, so dynamically keyed atoms leak memory unless you manually call the cleanup API. DevTools support exists but lags behind Redux DevTools in usability — time-travel debugging is not there. No built-in way to initialize server-side state without useHydrateAtoms boilerplate, which breaks down in more complex SSR scenarios.