Completed
Example 2: Reset state with keys instead
Class Central Classrooms beta
YouTube playlists curated by Class Central.
Classroom Contents
You Might Not Need useEffect - Common Misuses and Alternatives
Automatically move to the next video in the Classroom when playback concludes
- 1 useEffect is often used incorrectly!
- 2 useEffect basics
- 3 Setting dependencies correctly
- 4 Avoid infinite loops
- 5 Introduction to the problem of using useEffect unnecessarily
- 6 Example 1: Use derived state instead
- 7 Example 2: Reset state with keys instead
- 8 Example 3: Don’t wrap synchronous APIs with useEffect
- 9 Sometimes you DO need useEffect
- 10 Consider replacing direct useEffect usage with specialized libraries