DEV Community


Discussion on: 🔥 Learn React in 10 Tweets (with hooks)

seanmclem profile image

Hooks help functions replace classes only when those class components used state or life cycle. Otherwise it could have used a functional component all along and that's always been the alternative to classes. I'm not sure what my point was anymore but it's fun to discuss

Thread Thread
chrisachard profile image
Chris Achard Author

:) Yes - you're correct; the main use case for hooks is state or lifecycle (useEffect). You can also use useRef for reference though, useContext for context, and a few other things - but useState is probably most of the usage.