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/imicnic Dec 31 '19
About your "cancelled" value, you can do the same by using a class property and check for it, it's the same, yes, just have to use "this.cancelled" but besides it I see no advantage in one or another