A state library is easy to admire in a counter example and harder to judge in a real application. The difficult cases are shared edits, derived values, requests that finish out of order and workflows that should never enter an impossible combination of states. Choosing a familiar package name does not resolve those design questions.
Redux Toolkit, Zustand, MobX, Jotai and XState offer five different ways to organize application state. The decision is primarily architectural: explicit updates, a small external store, reactive objects, atoms or event-driven machines. This comparison uses current project documentation and describes evaluation criteria rather than claiming measured performance advantages.
Start by separating kinds of state
List what the application owns locally, what the server owns and what the URL should preserve. A temporary open menu, a cached customer record and a payment workflow do not necessarily belong in one global store. Putting everything into a library can create more synchronization problems than it removes.
Use a feature with genuine dependencies for evaluation: perhaps a product configurator with calculated totals and a save operation. Write down the expected changes before implementing it. Our JavaScript unit testing comparison covers runners that can help verify those transitions; this article concerns the state model being tested.
The quick difference
| Library | Best fit and strength | Important boundary |
|---|---|---|
| Redux Toolkit | Shared conventions, explicit updates and optional RTK Query caching | Distinguish client state from server-cache responsibilities |
| Zustand | A compact external store consumed through selectors | Store boundaries and subscription discipline remain your design |
| MobX | Observable domain models and automatically tracked derivations | Developers need to understand reactive tracking |
| Jotai | Composable primitive and derived atoms in React | Atom identity and store scope matter |
| XState | Explicit workflows modeled with states, events and actors | Modeling effort may exceed the needs of simple shared values |
Redux Toolkit
Redux Toolkit is the officially recommended approach to writing Redux logic. It supplies store configuration and utilities for defining slices and reducers, reducing setup work compared with assembling older Redux patterns manually. React integration uses React-Redux, while the underlying state logic is not confined to one component tree.
The main strength is a shared vocabulary. Teams can discuss actions, reducers and selectors and follow a recognizable structure across features. This can help a larger codebase where several contributors need to understand why data changed. The cost is maintaining those boundaries rather than letting every component invent its own update path.
RTK Query is included through separate entry points and is optional. It addresses fetching and caching server data, including request lifecycle concerns, rather than making every remote record ordinary hand-maintained client state. Evaluate it explicitly if remote data dominates your application. Redux Toolkit fits teams valuing conventions and inspectable updates, especially when they want an integrated option for server caching without requiring it for every feature.
Zustand
Zustand offers a small store model with state and update functions. React components can select the values they need through hooks, while a standalone store API supports use outside React. Its documented middleware includes persistence, Redux DevTools integration, Immer support and selective subscriptions. A basic application does not need a context provider around every consumer.
The appeal is a direct mental path from a shared value to an action that changes it. A small feature can keep related state together without adopting a full reducer convention. That flexibility is also the limitation: the package does not decide how many stores your application should have, which operations belong together or when data should be derived.
Review selectors during the pilot. Reading the entire store can subscribe a component more broadly than intended. Persistence also introduces restoration and versioning questions, rather than simply making state permanent. Zustand fits teams that want a modest external-store abstraction and are prepared to document architecture themselves. Server-rendered applications must deliberately establish request and hydration boundaries.
MobX
MobX organizes reactive behavior around observable state, actions and derived computations. Its runtime tracks which observable values are used, allowing dependent views and computations to respond to relevant changes. In React, the observer integration connects rendering to the observables a component reads; MobX itself can also be used independently of React.
This model can feel natural for applications with rich domain objects and calculations. A project editor can derive a total from observable items without manually maintaining a second total every time an item changes. Keeping derived information derived helps avoid competing copies of the same fact.
The tradeoff is that dependency tracking becomes part of the team’s debugging model. Developers need to understand where reads occur and where reactive observation begins and ends. Passing observable data through an unobserved boundary deserves deliberate handling. MobX is a useful candidate when object-oriented domain models fit the application and contributors will learn its reactivity rules. Do not select it on an untested promise that automatic tracking eliminates every rendering problem.
Jotai
Jotai uses atoms as definitions for pieces of state. Primitive atoms hold initial values; derived atoms read other atoms to compute results. Its React APIs allow components to consume those values, with additional utilities and extensions available when the application needs more than the small core.
The strength is composition. A feature can start with a few independent values and express dependencies as derived atoms instead of introducing one large application object. This is useful when different screens share some inputs but calculate different outputs. It also makes the graph of related values something you can reason about directly.
An atom configuration is not the same thing as the stored value. Jotai’s Provider documentation explains that values live in stores, and different Providers can scope them to different subtrees. Provider-less usage uses a default store. Decide that scope explicitly for isolated features and server-rendered applications. Jotai fits React teams comfortable with an atomic model, provided they maintain stable atom definitions and avoid an undocumented tangle of cross-feature dependencies.
XState
XState models state through events, state machines, statecharts and actors. Instead of starting with an arbitrary collection of mutable flags, a team can define which states exist and which events permit transitions. The current documentation describes XState v5 and separate integrations such as @xstate/react.
This is particularly useful for a process with meaningful stages: editing, submitting, awaiting a result, retrying and completed. A machine can make allowed behavior visible, rather than leaving every component to coordinate combinations of loading and error flags. Actors also provide a way to structure interacting units of logic.
The cost is the modeling work. A single shared preference rarely needs the same apparatus as a multistep approval flow. In React, understand the lifecycle of the actor created by the selected hook and use selectors where appropriate. The XState runtime and optional Stately visual or collaboration services are separate choices; a hosted editor subscription should not be assumed necessary to run a state machine in your own application.
A useful evaluation sequence
Build one representative feature with a derived total, an asynchronous save and a reset. Trigger a second edit before the first save returns. Check which result should win, whether stale data can reappear and how the interface recovers after failure. These questions expose ownership problems that a counter demonstration hides.
Then inspect the code as a maintainer. Ask a second developer to identify every operation that can change the total and explain how subscriptions work. Count additional concepts and custom conventions, rather than comparing line counts alone. A short implementation is not automatically an understandable one.
Run the same feature in the application’s actual rendering environment. Verify server-request isolation, hydration and persistence if they apply. None of these core packages charges by editor seat or application user; assess the selected package license, surrounding services, team learning and ongoing maintenance separately. Avoid unsupported speed rankings without a representative measurement.
Which model fits your application?
Choose Redux Toolkit for conventions and explicit updates, Zustand for a compact store, MobX for reactive domain models, and Jotai for atom-based composition. Choose XState when valid transitions and workflow lifecycle are the central problem. Combining models can be reasonable when responsibilities are clear, but each piece of information should still have one identifiable owner.
References
Official sources checked November 23, 2026. Plan availability and commercial terms can change.
- Redux Toolkit official product and documentation
- Redux Toolkit official usage, licensing or plan details
- Zustand official product and documentation
- Zustand official usage, licensing or plan details
- MobX official product and documentation
- MobX official usage, licensing or plan details
- Jotai official product and documentation
- Jotai official usage, licensing or plan details
- XState official product and documentation
- XState official usage, licensing or plan details
