Pergunta de entrevista da empresa Mindera

What are the downsides of setting state inside useEffect in React?

Resposta da entrevista

Sigiloso

26 de jul. de 2025

Setting state inside useEffect without proper dependencies can lead to infinite re-renders or performance issues, because every time state changes, the effect runs again, creating a loop.