Two Related Problems: 1


Two Related Problems:
1. useEffect is overused.
2. It's often hard to tell a useEffect is needless, because “useEffect” merely tells me *when* some code should run.

Solution: Name the function passed to useEffect.

✅Aids review
✅Clarifies intent
✅Helps us catch needless use

useEffect only tells me *when* some code should run.

A named function helps me understand *why* the useEffect exists and *what* it's supposed to do.

This helps me catch bugs too, because I often notice that the useEffect doesn't even do what the function name claims.

View original on X