React JS Quiz
HomeBlogPrivacy PolicyContact UsTutorialsNewBuy me a coffee

Side Effects with useEffect

  1. 1.What an Effect Is
  2. 2.The Dependency Array
  3. 3.Cleanup
  4. 4.When Not to Use an Effect
  5. 🏁 End-of-tutorial quiz
Advertisement
Tutorials/Intermediate/Side Effects with useEffect

Side Effects with useEffect

Synchronise a component with the outside world: how effects run, what the dependency array really means, why cleanup matters, and when not to use an effect at all.

Level
Intermediate
Chapters
4
Exercises
1
Reading time
18 min
Start the tutorial →

What you will cover

  1. 1. What an Effect IsSynchronising with systems outside React, and when the effect body runs.
  2. 2. The Dependency ArrayThe three forms of the second argument and what each one means.
  3. 3. CleanupReturning a teardown function, and why React runs it more often than you expect.
  4. 4. When Not to Use an EffectThe four cases where an effect is the wrong tool, and what to do instead.
Already know this? Jump to the 8 question quiz →

Up next after this one: Refs with useRef

Advertisement
Advertisement
Support the developer