3 ms·
> State should change in response to user inputs. Absolutely not only to user inputs, but any kind of event: response, websockets, push notification, worker ta
by the_gipsy 4y ago
> State should change in response to user inputs.
Absolutely not only to user inputs, but any kind of event: response, websockets, push notification, worker task finished... a million things beyond the basic "click".
> If that function isn't pure you're gonna have a bad time.
Hooks let you deal with "component lifecycles" which make that function not pure. Only the most basic toy react components are pure, everything is about side effects IN your views.