DEV Community

Discussion on: Is Redux Needed After Hooks?

Collapse
 
mario_sommer profile image
Mario Sommer • Edited

To my understanding hooks are a new and additional way to access and alter component state as well as give you access to the component lifecycle methods. You could more or less do the same things as you could do using class components. Since hooks are functions they can be reused more easily throughout the application. In my opinion, the big advantage of hooks is that you don't need to use a JavaScript-class to access state/lifecycle methods. I don't like using classes so I am glad "this" is over 😜
That said, if you want you can still use class based components the way you always did.

So if you app "needs" redux right now it will continue to do so. One thing though, using context became also a little bit easier as well. So maybe the threshold of one switching to a global state management shifted a little bit towards using context a little bit longer, but that is completely up to personal preference.

For more information this talk from Dan Abramov introducing hooks is a great start: youtu.be/dpw9EHDh2bM?t=682

Also I would recommend continue watching Ryan Florence talk right afterwards (also in the video linked above)