useEffect is a funny hook if you aren’t familiar with side-effects. In particular, re-thinking your way of conceptualizing UI elements out of imperative operations (where objects are told what to do) to effective behaviors (where UI elements are described in a declarative style that separates what they are from how they behave) is a key element of being a successful React developer today.

useEffect can be called three ways:

No second argument
Empty array [] as second argument