← Back to blog

You Probably Don't Need Redux Yet

5 min read
#react#state-management#context#hooks

When you start learning React, the list of things to cover feels endless: components, props, state, hooks, effects, routing. And somewhere in that list, usually right after you figure out useState, someone mentions Redux or Zustand. The implication is clear: if your app is going to be serious, you need a global state management library.

But here is the thing: you can skip it at first. Not because these libraries are bad — they aren't — but because most of the state in your app doesn't belong to them in the first place.

👉 Try it in practice: Shopping Cart

Most state is server state

Think about the data flowing through a typical app. A list of products, a user profile, search results, a dashboard with metrics. Where does it come from? An API. Where does it go when you update it? Back to the API.

This is server state — data you fetch, mutate, and cache, but that you don't own. Its source of truth lives on a server. And managing it with a global client store means you are now responsible for cache invalidation, refetching on focus, optimistic updates, and deduplication — all problems that libraries like SWR or React Query (TanStack Query) solve out of the box.

With SWR, a product list becomes a single hook:

No store. No reducers. No dispatching a FETCH_PRODUCTS_SUCCESS action. The hook handles loading, caching, refetching, and error state. And if you need to update a product, mutate revalidates the data automatically. The state you used to push through a global store is now handled declaratively.

What is left? Local state and context

Once you pull all server data into SWR, what remains on the client side? Usually very little. A sidebar that expands and collapses. A modal that opens and closes. A selected tab in a filter bar. Maybe a theme toggle.

These are toggles. useState is enough for every single one of them. Create it close to where it is used:

If the toggle needs to be read three levels down the tree, you might be tempted to reach for a global store. But React gives you context for exactly this: sharing state across a subtree without prop drilling.

Wrap the part of the tree that needs the cart, and leave the rest untouched. Context is not global state — it is scoped to its provider — and that is exactly why it works. A header component outside the provider does not re-render when the cart changes. A sidebar inside it does.

The rule of thumb: use context for subtree state, not application state. If you find yourself wrapping your entire app in a provider and fighting re-renders, the problem is not that you need Redux — it is that the state should not have been global in the first place.

So when do you need a global store?

There is a category of apps where client state genuinely dominates. A drawing app where every shape on the canvas has coordinates, color, rotation, and z-index. A collaborative whiteboard with dozens of objects updated in real time. A video editor with a timeline, layers, and undo history. In these cases, the state is not fetched from an API — it is created by the user on the client, and it is deeply interconnected.

This is where Zustand shines. A single, mutable store with no boilerplate, no providers, and fine-grained subscriptions that prevent unnecessary re-renders:

Notice the difference from the context example above: the state here is complex, every action touches it, and the performance characteristics matter because the canvas updates at 60 frames per second. This is not a shopping cart. This is not a sidebar. And most apps — including most production apps — are not this.

The trap is that early-stage apps look at these libraries and think "I will need this eventually." But by the time "eventually" arrives, the complexity these libraries were meant to solve is already present in the codebase, and you know exactly what shape your state takes. Adding a store at that point is a deliberate architectural decision based on real problems, not a preemptive one based on fear.

The majority of React apps can be built with three things: SWR or React Query for server state, useState for local toggles, and context for sharing across subtrees. Zustand and Redux are excellent tools — but they solve a problem most apps simply do not have yet. Skip them until the code tells you otherwise.

👉 Build it yourself: Shopping Cart — manage a cart with context and provider, no global store needed.