4 ms·
Are you talking about event hooks, like https://m.mediawiki.org/wiki/Manual:Hooks https://m.mediawiki.org/wiki/Manual:Hooks ? If so, your comment is one for the
by stevebmark 5y ago
Are you talking about event hooks, like https://m.mediawiki.org/wiki/Manual:Hooks https://m.mediawiki.org/wiki/Manual:Hooks ? If so, your comment is one for the record books of misunderstanding.
- zeroq 5y agoHow 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.
- stevebmark 5y agoYou have a common misconception of hooks that they are only lifecycle callbacks, I suggest https://epicreact.dev/myths-about-useeffect/ 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.