← React Beginner Questions - Set 12 Q113
What are side effects in React, and how can you manage them?
React Beginner Questions - Set 12
Example
1
2
3
4
useEffect(() => {
const id = setInterval(poll, 5000);
return () => clearInterval(id);
}, []);
What to notice
- Side effect = anything outside rendering; `useEffect` is where it lives.
← Back to the question list