DEV Community

Discussion on: A Hooks-vs-Classes Report Card

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

hooks are great because of the shared state and useContext() hook

Absolutely. This is probably the primary reason why I've switched most/all of my new dev to Hooks. They have some definite... drawbacks. But the positives can also be powerful.

I've spent countless hours trying to recreate lifecycle components, which I could have done in 10 minutes with a class-based component. useEffect() is a pain to work with.

Amen. Amen. And, oh... did I mention?? Amen.

Collapse
 
wejdi_gh profile image
Wejdi

You can easily use Redux for state management ...

Thread Thread
 
bytebodger profile image
Adam Nathaniel Davis

I could also use a sandblaster to wash my hands...

Thread Thread
 
wejdi_gh profile image
Wejdi

hahaha very funny :) it depends on how complex your application is going to be . Context is for low-frequency updates and simple Alpplication , but Redux is the most powerful solution for complex application state .

Thread Thread
 
bytebodger profile image
Adam Nathaniel Davis

I understand that if you're a "Redux guy" then you're probably gonna continue to be a "Redux guy" - probably for a very long time. But with the improvements to the Context API and the ability to use shared Hooks, I don't honestly understand why anyone would ever want to inject the megalithic monstrosity that is Redux into a new project. I've written several articles highlighting my not-so-subtle feelings about Redux.

Thread Thread
 
wejdi_gh profile image
Wejdi

I understand also that if you're "NOT" a "Redux guy" then you're probably gonna continue to be "NOT" a "Redux guy" - probably for ever :)
Peace .