4 ms·
I would argue that other than eschewing classes for bare functions, there is nothing functional (as in "Functional Programming") about React or hooks. Simply re
by petilon 5y ago
I would argue that other than eschewing classes for bare functions, there is nothing functional (as in "Functional Programming") about React or hooks. Simply removing classes and calling it "functional" is a stretch.
- shawnz 5y agoThey didn't call it "functional" though. They simply said that it is more functional than it was previously. If you reserve the word "functional" for only the most idealistic implementations of those ideas then it just makes it unnecessarily difficult to describe things which are in the middle. Basically, I think "functional" is more of an axis than it is a circle on a Venn diagram.
- petilon 5y ago> They didn't call it "functional" though. See [1] where they say "if you’re a functional programming purist and feel uneasy about React relying on mutable state as an implementation detail, you might find it satisfactory that handling Hooks could be implemented in a pure way using algebraic effects". [1] https://medium.com/@dan_abramov/making-sense-of-react-hooks-fdbde8803889 https://medium.com/@dan_abramov/making-sense-of-react-hooks-...