r/reactjs • u/atapas • 20h ago
Discussion What’s the real problem with useEffect in React?
Here is my honest question:
What's the actual problem with the useEffect hook? All over the X/twitter, I see a lot of negativity about this hook. It seems like a buggy thing in React.
My opinion is that developers blame useEffect because it's often used for data fetching as the primary use case. As we deal with various states like loading, data, error etc… synchronization of these causes bugs.
Also, a misunderstanding of the rendering cycle in React, such as where useEffect gets called could introduce additional misuses and bugs.
Hence, just saying useEffect is evil, may not be the right assumption is what I think. But, there could be cases that I'm missing.
What's your take or opinion about it?