DEV Community

Discussion on: How to replace component lifecycle with useEffect hook in React?

Collapse
 
yvonnickfrin profile image
🦁 Yvonnick FRIN • Edited

Nice article! The effect you wrote for the componentDidUpdate example will be also called at mount. You need to use a ref to ensure it isn't called at mount 😄 (This is a detail)

Collapse
 
ibrahima92 profile image
Ibrahima Ndaw

That detail matters a lot. Thanks for your comment