by jameshart · 4y ago · 0 comments
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.
React has always been an exercise in smoke and mirrors.