DEV Community

Discussion on: Is there a way to explain hooks without mentioning class component?

Collapse
 
dylanesque profile image
Michael Caveney

I think it's definitely possible, but I wonder what the mental gymnastics to do so will accomplish, given that hooks have been a part of "official" React for barely two weeks, and that stateful components are all over the place in production code. I've pondered this question myself, and I think about that thing that Kent C. Dodds said about "You should feel that pain caused by a problem before you reach for a third-party dependency that solves it.", and that hooks are similar. They certainly reduce a lot of code, but learning about how "vanilla" state was handled with class components, Redux, etc will contextualize how great hooks are, and precisely how much effort they can save us.