2 ms·
In contrast, https://www.simplethread.com/cant-replace-redux-with-hooks/ https://www.simplethread.com/cant-replace-redux-with-hooks/ https://daveceddia.com/con
by satvikpendem 7y ago
In contrast,
https://www.simplethread.com/cant-replace-redux-with-hooks/ https://www.simplethread.com/cant-replace-redux-with-hooks/
https://daveceddia.com/context-api-vs-redux/ https://daveceddia.com/context-api-vs-redux/
https://medium.com/javascript-scene/do-react-hooks-replace-redux-210bab340672 https://medium.com/javascript-scene/do-react-hooks-replace-r...
TL;DR Context can replace some but not all of Redux. Redux can figure out which components to rerender based on what's being computed. Context doesn't, so it's basically the same as refreshing your entire component tree every time something changes. You could build it yourself, but at that point, you're just reinventing Redux.
I also like the Redux Toolkit (https://redux-toolkit.js.org/ https://redux-toolkit.js.org/) which is an opinionated way to write Redux that cuts down the boilerplate a lot. createSlice is easily one of the best features, you can encapsulate Redux logic for each different type of content, like authentication, users, posts, etc.
- acemarke 7y agoGlad to hear that RTK is working well for you! I'm currently working on updating the Redux core docs to teach RTK as the default way to use Redux. Hoping to have the new "Quick Start" tutorial page up in the near future.