3 ms·
Hooks. Brilliant new idea. It was a blast working with them in MediaWiki in 2005. JS community is adorable. They are like a little infant rushing to you with a
by zeroq 5y ago
Hooks. Brilliant new idea. It was a blast working with them in MediaWiki in 2005.
JS community is adorable. They are like a little infant rushing to you with a snow on his hands "look pa, it's wet!".
I'm excited to see what they are going to rediscover next.
- stevebmark 5y agoAre 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.