This page[0] lists many situations in which useEffect shouldn’t be used. Some might seem counter-intuitive.
- Don't use effects for things that aren't genuinely effectful
- Put finnicky state management stuff in reusable utils instead of re-implementing it from primitives over and over again.
Neither is React-specific.
That's a bunch of examples where there are good alternatives.