MemotivauseEffect and Side Effects

What is the dependency array in useEffect?

useEffect and Side Effects

Audio flashcard · 0:11

Nortren·

What is the dependency array in useEffect?

0:11

The dependency array is the second argument to useEffect. It tells React which values the effect depends on. The effect re-runs only when one of those values changes. An empty array means the effect runs only once after the first render.