React
Lesson 3 of 8
38%
Free Section Starter (Lesson 3)
REACT Free Section Starter Challenge 30 min

3. Managing Side Effects with useEffect()

Overview: Synchronize external APIs, update document.title, and handle timers.

Concept & Syntax Guide

`useEffect(fn, deps)` runs after render. Specifying an empty dependency array `[]` ensures the effect runs only once when the component mounts.

Hands-On Practice Exercise

Update Document Title on Mount

Use `useEffect` to set `document.title = "Stro Hafta Catalog"` when the component mounts.

Target Output: Stro Hafta Catalog
Need a hint? Click here to reveal
Hint: Check syntax carefully and make sure your code contains: Stro Hafta Catalog
REACT Code Editor
1
2
3
4
5
6
7
8
9
10