4 ms·
Endless useEffects is an indication that useEffect is being used incorrectly. In mostly projects you should only see a few instances of useEffect. This might b
by squidsoup 3y ago
Endless useEffects is an indication that useEffect is being used incorrectly. In mostly projects you should only see a few instances of useEffect.
This might be helpful https://react.dev/learn/you-might-not-need-an-effect https://react.dev/learn/you-might-not-need-an-effect
- com2kid 3y agoIf the same problem pops up a lot when using a framework, then at some point the framework is to blame. Yelling at developers "you are doing it wrong!" is meaningless, frameworks should naturally lead people towards the correct behaviors. React does no such thing.
- squidsoup 3y agoNot a problem with the library, but a documentation issue. The advice around how to correctly use useEffect was a bit ambiguous in the old documentation, but thankfully is much better in the new docs.