News for hackers. Stuff that matters.
Re:A Visual Guide to UseEffect by andix on Tuesday December 27, 2022 @06:30AM (#34147762)
Edit: okay, the docs show cases where there are no side-effects. For me it’s completely obvious not to use a hook for that…

Aren’t useState and useEffect the two main building blocks for hooks (besides useContext)? Everything is derived from those two.

So I don’t get how it would be wrong to handle any of those things with useEffect. It may not be the most easy to read code, but in the end it’s all useState and useEffect under the hood.

There are no comments on this comment yet.