3 ms·
> I don't really see the value. One benefit is performance. useEffect() causes cascading updates when it alters state. The other is that it's way harder for y
by scotty79 3y ago
> I don't really see the value.
One benefit is performance. useEffect() causes cascading updates when it alters state.
The other is that it's way harder for your code to turn into spaghetti if you don't sidestep the whole concept of React where raw events trigger global state updates which causes react to do automatic re-render of UI which provides user with means of generating events. React should have one large loop, not multitude of small ad-hoc ones built on the side with useEffect().