|
|
|
|
|
by jefb
1381 days ago
|
|
React's push towards a functional model with all the use* hooks is so sad to watch. A stateless programming model in a domain where state is so fiercely coupled to program utility is inevitably going to spawn this garbage. Class based components with MobX managing state was, and still is, a dream to write __and__ read. |
|
Literally, calling ‘useMemo’ twice returns two different objects, because the function keeps track in internal state of how many times it has been called.
Hooks are very deeply imperative.
They are a way of obtaining some benefits that are easily obtained in functional programming via higher-order functions, but expressed in a way that makes them easily consumed in an imperative code body.