Re:React is becoming a black box
by mplanchard on Thursday September 03, 2020 @09:52AM
(#24364025)
I agree with your take, and what bothers me about hooks is that they aren’t even “functional”. They’re making what otherwise look like pure functions into stateful functions, whose return values can change on subsequent calls. This could have been largely averted by passing a hook manager into component functions, an idea that was brought up in the hooks RFC but rejected.
I prefer the class-based approach for stateful components because at least then it’s clear that the component has some state it is managing and how.
I prefer the class-based approach for stateful components because at least then it’s clear that the component has some state it is managing and how.