DEV Community

Discussion on: Constructors in Functional Components With Hooks

 
alexvukov profile image
alex-vukov

Thank you for writing this article! I thought I was missing something by always having to skip renders with a flag which is set only after a fetch is started in useEffect or trying to do fetch calls in something like your constructor. Seems that React devs have missed the point that sometimes you need to have a cause before you can handle the effect...

Thread Thread
 
bytebodger profile image
Adam Nathaniel Davis

Having spent years working with the lifecycle methods that are available in class-based components, I'll be the first to tell you that they can, at times, cause major headaches. But the Hooks team seems to have decided that the way to cure the headache is to cut off the head.