Comparing
Primitive and flexible state management for React based on atomic state units.
Declarative client-side routing for React — maps URLs to components with nested routes, loaders, and actions.
| Metric | jotai | react-router |
|---|---|---|
| Ecosystem | npm | npm |
| Difficulty | Beginner ✓ | Intermediate |
| Weekly downloads | 900K | 11.0M↑ |
| Latest version | v2.9.3 | v7.1.1 |
| Recipes | 2 | 3↑ |
jotai only
Shared
react-router only
React apps needing shared state without prop drilling, derived/computed state that updates automatically, fine-grained re-render control, per-route or per-feature isolated state.
Any React SPA needing URL-based navigation, nested layouts (dashboard sidebar + content), data loading tied to routes, form actions, protected routes.
Non-React environments (Jotai is React-only). Complex state machines (use XState). Apps already committed to Redux with large middleware ecosystems.
Next.js (use its file-based router). Remix (built on React Router but adds SSR). Very simple apps with only one or two views — a state variable suffices.
jotai
react-router