← React Intermediate Questions - Set 4 Q32
What is the difference between `componentDidMount` and `useEffect`?
React Intermediate Questions - Set 4
Example
1
2
componentDidMount() { load(); }
useEffect(() => { load(); }, []);
What to notice
- Equivalent for mount; the hook also covers updates through its dependency array.
← Back to the question list