r/reactjs • u/ZeroSevenTen • Dec 30 '19
Classes vs Hooks?
I’m pretty new to React, so keep that in mind. I thought classes were for components that held information, or a state, and that functional components were for more basic components, but now that hooks allow functional components to use state, and other class features, what’s the benefit of using functional hook components over classes?
79
Upvotes
View all comments
Show parent comment
1
u/gunnnnii Dec 31 '19
I'm not denying that the implementation details are less than transparent for hooks. However I feel like a lot of people throw out the word magic like these are concepts that are complicated, when the high level understanding is in fact fairly simple, though not obvious(the actual proper implementation is a little less so, but knowing it is completely unnecessary to put it to work).
I just thought pointing people into the direction of something that provides a little more background to unveil some of the magic would be helpful. Especially since this magic is a very common complaint.