HN user

foomatic

24 karma
Posts0
Comments14
View on HN
No posts found.

Oh ok. I'd agree Hooks compose much better then. But there was no attempt or consideration at compositional API for class based components besides getting rid of it entirely and then adding functions that hook into the nether nether.

For example, the equivalent of useEffect required calls inside of componentWillMount, componentDidUpdate, and componentWillUnmount.

Yeah from what I recall this was the prime motivational example given in the React docs for introducing hooks. It's a legit problem. But hooks and getting rid of class based components is not the only solution. In classical OO are also well worn solutions along the lines of hooks, they just work with classes / objects with interfaces still. It's somewhat frustrating that this is never even considered.

"useCallback" is not very intuitive naming. I'd guess a fair bit of the confusion could be attributed to this alone. Could have been useMemoizedValue useMemoizedCallback at least. The whole useXXX naming convention is also unintuitive.

This can be contrasted with traditional market economies where large corporations start off as small companies and become dominant through innovation, growth, and generally meeting consumer demands.

Or when the govt sells off public assets ...