DEV Community

Discussion on: Why I Stopped Using Redux

Collapse
 
farazamiruddin profile image
faraz ahmad

I agree with your statements about Redux. The problem honestly is the way it's used.

If used to only store state that is actually global, it's fine. However, I think most of the time a lot of us like to default to throwing things into the global store to avoid prop drilling.

You can simply use context these days to avoid prop drilling. We've been replacing our application at work from Redux and moving towards using useState and useReducer, along with context. It's been fantastic.

If you're interested, you can check out my pattern for React Context

Collapse
 
g_abud profile image
Gabriel Abud

I've been doing the same thing on all of my projects, moving to pure useReducer, useContext, and useState. I am sure there are legit cases for Redux but I think it's for a select few, really complex applications.

If you haven't tried react-query or similar library, I'd encourage you to try them out as well. It handles the data layer really cleanly and independently from context.

Collapse
 
vitya profile image
Victor Kasap

I have one problem here re-rendering 100500 components when using the context? =)))