DEV Community

Discussion on: State Management in React: When to Use What

Collapse
 
cullophid profile image
Andreas Møller • Edited

In my experience redux can work well for small apps, but it's very hard to manage when your app grows.

The best option I have found for managing state in larger apps is to let each page manage its own state, and use context for things like auth, that spans multiple pages.

I have used redux a lot, but at this point I don't think I can come up with a scenario where I would recommend it.

Collapse
 
singhshemona profile image
Shemona Singh

I like that pattern - letting each page manage its own state!

Do you feel like Redux can be overkill?

Collapse
 
cullophid profile image
Andreas Møller

No I think it solves the wrong problem.
Redux separates your state logic from your view logic. Initially that sounds simpler, but in actuality that doesn't help you when your app scales.

Each new feature you add to your app will lost likely require both view and state updates, so it's usually much more scalable to split your code by feature, than by state/view.