Your team is starting a React Native sneaker store for users on low-end Android phones; how would you choose between Context, Redux Toolkit, Zustand and Jotai for client state?
answer
- first subtract server state
- what is left is usually small
- render cost on the slowest device
- access from outside the tree
- team size and conventions
basics
~20 sMove server data to a query cache first, then size what remains. Context suits rare changes, Zustand or Jotai suit small fast-changing state with narrow subscriptions, and Redux Toolkit suits large teams wanting enforced structure.
solid answer
~50 sI would first take server data out of the question: listings, prices and order history belong in a server-state cache, which usually leaves a small client core of cart, filters, UI flags and session. Then I weigh four things. Update frequency times consumers: fast-changing state read in many places, like the cart, needs selector-based subscriptions, which rules out one broad Context on low-end Android. Access outside the tree: Headless JS tasks, notification handlers and API modules need an importable store. Team size: Redux Toolkit's slices, actions and middleware give a large team one enforced pattern at the cost of ceremony; Zustand is minimal but relies on conventions; Jotai fits many small independent pieces. Persistence: the choice must hydrate cleanly from on-device storage. For this app I would likely use Zustand or Redux Toolkit for the cart, Context for theme and user, and record the decision.
go deeper
Recall what each option is: Context passes a value down, while Redux Toolkit, Zustand and Jotai are stores components subscribe to.
Explain why fast-changing state read widely needs selector-based subscriptions, and which options give them.
Justify a concrete choice for a specific app using render cost on low-end Android, out-of-tree access and persistence.
Own the tradeoff between structure and ceremony for the team, record the decision with its revisit triggers, and keep the number of state models small.
## Step one: shrink the problem Most state in a sneaker store is **server state**: the catalogue, stock levels, prices, order history. That data is owned by the backend, goes stale, and needs caching, refetching and deduplication; a server-state cache does that better than any client store. Once it is removed, what remains is usually small: - the cart and its quantities; - filters and sort order that must survive navigation; - UI flags such as a dismissed promo sheet; - session information such as the signed-in user and theme. The library choice is about this remainder, and it is often smaller than the team expects. ## The criteria that differ on React Native | Criterion | Why it matters on a phone | What it favours | |---|---|---| | Change frequency times consumers | every re-render runs on the single JavaScript thread; low-end Android has the least headroom | selector-based stores for hot state | | Access outside the React tree | Headless JS tasks, notification handlers and API modules must read and write state | an importable store object | | Persistence and hydration | state is restored from on-device storage at every cold start | a library with a clean persist story for your storage | | Team size and turnover | many authors need one obvious pattern | enforced structure | | Debugging | you need to see what changed and why | action logs or devtools support | ## How the four options land **Context** is not a state manager; it is a way to pass a value down. It is excellent for values that change rarely and are read widely, such as theme, locale and the user. It is a poor home for the cart on a low-end device, because every consumer re-renders on every change and it cannot be read outside the tree. **Redux Toolkit** gives slices, action creators, middleware and a single store. Its strengths are **predictability and structure**: every change is an action, which helps debugging and code review in a large team, and the store is importable anywhere. The cost is ceremony that a small app may not need. **Zustand** gives a hook-based store with selectors and very little boilerplate, and its store is also importable outside React. Its weakness is the flip side: with no enforced structure, a large codebase can drift into many inconsistent stores unless the team sets conventions. **Jotai** models state as small atoms that components subscribe to individually, which suits many independent pieces, such as per-product UI state, and gives fine-grained re-renders by construction. It is less natural for one central entity like a cart with business rules, and out-of-tree code must use the same store object the `Provider` uses. ## A recommendation, and its conditions For a sneaker store built by a small team: 1. server data in a query cache; 2. the cart in **Zustand**, with narrow selectors and actions that outside code can call; 3. theme and user in **Context**. For a large team or one with Redux experience, **Redux Toolkit** for the cart instead, taking the ceremony in exchange for one pattern everyone follows. Either way, avoid mixing all four; each extra library is another mental model for every new hire. ## How to make the decision stick - Write it down with the criteria above and the device you are optimising for. - Prototype the hardest screen, usually the catalogue list with cart badges, and measure it on the slowest supported Android device in a release build. - Revisit when the client core grows, for instance when offline edits or complex multi-step flows arrive; a choice that fits a small core may not fit a large one. There is no single right answer. Interviewers are looking for the order of reasoning: subtract server state, measure the render cost on real devices, and match the library's structure to the team that will live with it.
- What would make you move the cart from Zustand to Redux Toolkit later?Growth in authors and rules rather than in data size: several teams editing cart logic, a need for an auditable log of every change, complex middleware such as analytics or offline queueing hooked on actions, or repeated bugs from inconsistent store patterns. Those are problems Redux Toolkit's enforced structure solves; raw performance is rarely the reason.
- Why is 'we might need it later' a weak reason to adopt Redux Toolkit on day one?Once server state lives in a query cache, the client core is often a cart and a few flags. Paying Redux Toolkit's ceremony for that slows the first release without a benefit yet, while moving a small, selector-based store to Redux Toolkit later is a bounded refactor. Choose for the state and team you have, and record when you would revisit.
saying these in an interview costs you the question
- Redux Toolkit is always the right choice for any production React Native app
- Context is a full state-management library that can replace a store
- Choosing a store should come before deciding where server data lives
- Library choice matters more for re-render cost than how components select state
- Using all four libraries lets each part of the app pick the best tool