← React Intermediate Questions - Set 9 Q81

What is the purpose of `useEffect` in React?

React Intermediate Questions - Set 9

Example

useEffect(() => { fetch('/api').then(r => r.json()).then(setData); }, []);

What to notice

← Back to the question list