Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How so?

"Hooks are functions that let you “hook into” React state and lifecycle features from function components." and "[hook] adds the ability to perform side effects from a function component. It serves the same purpose as componentDidMount, componentDidUpdate, and componentWillUnmount in React classes". Quotes from React docs.



You have a common misconception of hooks that they are only lifecycle callbacks, I suggest https://epicreact.dev/myths-about-useeffect/ to get a stronger mental model. They can mimic lifecycle callbacks but they're a superset of that ability. Also, I'm not sure why you chose Mediawiki as the thing that has lifecycle callbacks, the concept has probably been around as long as callbacks have been a thing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: