4 ms·
Context and Redux are somewhat different tools and context doesn't necessarily solve the same problems as Redux. This article by the maintainer of Redux (acemar
by cercatrova 4y ago
Context and Redux are somewhat different tools and context doesn't necessarily solve the same problems as Redux. This article by the maintainer of Redux (acemarke) goes over why (looks like he replied to you as well) [0]. Have you tried Redux Toolkit as well? It cleans up a lot of the complexity of Redux and works well with TypeScript [1].
[0] https://blog.isquaredsoftware.com/2021/01/context-redux-differences/ https://blog.isquaredsoftware.com/2021/01/context-redux-diff...
[1] https://redux-toolkit.js.org/ https://redux-toolkit.js.org/
- Waterluvian 4y agoBasically I’m not saying redux is bad. Just that after years of using it for production software I concluded it’s still overkill for my needs. IIRC Redux is also just an abstraction on top of Context. Fundamentally it gives you pseudo-global access to application state by being able to interact with it anywhere in the component tree below the context manager.
- acemarke 4y ago> Redux is also just an abstraction on top of Context No, this is a very common but incorrect misunderstanding of how Redux works. It's true that React-Redux does use context internally... but only to pass down the Redux store instance, _not_ the current state value. Also, because Redux itself is separate from React, there's a lot of things you can do with it that are completely different than what Context does. _One_ bit of overlap is that both can be used to access state across the component tree, but Redux does much more than that. See my post here for more details: https://blog.isquaredsoftware.com/2021/01/context-redux-differences/ https://blog.isquaredsoftware.com/2021/01/context-redux-diff...
- cercatrova 4y agoI posted that same article above, I'm not sure if they didn't read it the first time that they'll read it the second time, lol By the way, thanks for your hard work on Redux, appreciate it.