useEffect and Dependencies
What this is. An effect synchronizes your component with something outside React: a request, a subscription, a timer, the document title.
It runs after the render is on screen. The array in the second argument decides when it runs again.
The dependency array is a list of what the effect reads. Leave something out and the effect keeps using the value it captured the first time, quietly, forever.
The linter warning about missing dependencies is almost always describing a real bug. Do not silence it. Fix the effect, or restructure so it does not need that value.
Mark this lesson complete
Signed in, your progress follows you to every device.