|
|
|
|
|
by jameshart
1388 days ago
|
|
I wish people would stop saying this. Hooks aren’t functional or stateless. 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. |
|