Simplifying State Management in React: My Experience Migrating to Jotai

A few months ago, I was knee-deep in refactoring a mid-sized React application. We were using Redux for state management in React. The project wasn’t even that massive, but somehow we had ended up with a tangled web of reducers, middleware, slices, and boilerplate that seemed to grow with every new feature. Just adding a toggle for dark mode felt like launching a spaceship.

That’s when I stumbled upon Jotai—a state management in React library that calls itself “primitive and flexible.” I was skeptical at first. Redux had been reliable, battle-tested, and familiar. But I was tired of writing verbose slice logic for every small interaction. So, I took a weekend to prototype a new version of the app using Jotai + Vite + TypeScript. And honestly? I haven’t looked back since.

Let me walk you through how I replaced Redux with Jotai in a real-world crypto dashboard app, and why I think it’s one of the most underappreciated tools in the React ecosystem today.

What Makes Jotai Different?

If Redux is like setting up a full-blown assembly line to produce a sandwich, Jotai is like just grabbing bread, cheese, and a knife and getting to work. In terms of state management in React, that simplicity makes a huge difference.

With Jotai, you don’t need:

Jotai, you don’t need:

▪️An external store configuration

▪️Boilerplate for slices or reducers

▪️Middleware setup

▪️Connected components via HOCs or hooks like useSelector

Instead, the state is modeled as atoms—simple units of state that can be read and written from anywhere in your React tree.

Real-World Project: Crypto Dashboard with Jotai

To fully understand Jotai’s strengths in state management in React, I built a crypto tracking dashboard using public APIs like CoinGecko. The app supports login (auth state), theming (light/dark mode), navigation, and real-time data updates. Let me break down how the architecture changed compared to Redux.

1. Store Setup: No More configureStore or Persistor

In Redux, you probably have something like this:

configureStore or Persistor

With Jotai, your store is the atoms themselves. Here’s the authAtom:

 

useAtom() or useAtomValue()

That’s it. You can read/write this atom from anywhere with useAtom() or useAtomValue().

2. Replacing Slices with Atomic Logic

Instead of writing reducers and createAsyncThunk logic, Jotai lets you define derived atoms or async atoms easily:

Replacing Slices with Atomic Logic

To toggle:

Const theme

In Redux, this would’ve taken a slice, an action creator, a reducer, and a dispatch logic. Here? Two lines.

3. Global Access — Like Redux Store

Yes, atoms can be accessed globally. If you need to access them in a utility function, Jotai offers getDefaultStore():

Jotai offers getDefaultStore()

That saved me a ton of headaches when doing authenticated fetches or conditionally redirecting users.

4. Theming with Jotai and Tailwind

Jotai makes theming almost too easy. Here’s how I did it:

Theming with Jotai

And then in your App.tsx:

Theming with Tailwind

Tailwind picks up the class and switches colors beautifully. You can even persist the theme in localStorage using atomWithStorage().

Challenges I Faced (and Solved)

It wasn’t all rainbows. Some initial hurdles:

▪️No Centralized Devtools like Redux: Jotai doesn’t have a first-party Redux DevTools extension yet, but there are community plugins like jotai-devtools.

▪️Debugging Async Atoms can be Tricky: When atoms derive from other async atoms, tracking what’s triggering what can be confusing. I recommend breaking things into granular atoms.

▪️SSR Requires Careful Setup: If you’re doing SSR with Next.js, you’ll need Provider and atom hydration.

But honestly, once I got over these bumps, my productivity soared.

Why I’m Not Going Back to Redux Anytime Soon

Redux is great, especially for massive enterprise apps where state management in React becomes extremely complex. But for most apps (even large ones), Jotai is more than enough and comes with a fraction of the complexity.

With Redux:

▪️I was spending 30% of my time wiring things up

▪️The learning curve for new devs was steep

▪️Every new feature required too much ceremony

With Jotai:

▪️I focus on features, not setup

▪️State logic is modular, reactive, and colocated

▪️There’s zero boilerplate

coma

Conclusion

If your team is drowning in Redux boilerplate and spending more time debugging your store than building features, give Jotai a shot. It’s elegant, powerful, and redefines state management in React for the better.

And if you’re building a dashboard, or any app that juggles UI state, authentication, theming, and API data, Jotai just works.

I’ve now used Jotai in three production apps. Each time, onboarding was smoother, the code was cleaner, and I felt like I was working with React instead of fighting it.

Keep Reading

Keep Reading

  • Service
  • Career
  • Let's create something together!

  • We’re looking for the best. Are you in?