React 31 ⚛️ Effect Dependency Array Rules
The dependency array is the control panel for useEffect. It determines when the effect runs, when it is cleaned up, and when it is skipped. The rules that govern it are simple to state and easy to violate: include every value from the component scope that the effect reads. The consequences of violating them are…