4 ms·
> It makes purely functional frameworks like modern react much easier to deal with. But hooks aren't pure functions. They aren't referentially transparent and
by charlotte-fyi 3y ago
> It makes purely functional frameworks like modern react much easier to deal with.
But hooks aren't pure functions. They aren't referentially transparent and have an implicit dependency on call order. Likewise, React components aren't "functional" the second you use any of these APIs which subscribe to effects, state, context, whatever coming from elsewhere. React is simply not a "pure functional" enterprise and it's strange to represent it as simply a "violation of some theoretical principles." Those principles are the entire basis of what constitutes functional programming, which is why the original parent described this as not-functional not-oo.