[0] https://react.dev/learn/you-might-not-need-an-effect
- 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.
[0] https://react.dev/learn/you-might-not-need-an-effect