DEV Community

Discussion on: How to use componentDidUpdate in React

Collapse
 
joshmanton profile image
josh-manton

It is not 100% correct to say that componentDidUpdate() is called after componentDidMount(). In the lifecycle of a Component, componentDidMount() is called in the Mounting phase. While componentDidUpdate() is called in the Updating phase.

If there is a state change in the Updating phase that will trigger componentDidUpdate().

This is an important distinction.

Collapse
 
djsmacker01 profile image
Adewale Adedeji

correct

Collapse
 
cesareferrari profile image
Cesare Ferrari

Thank you for the clarification.

Collapse
 
ibadeecodes profile image
Ibad Ullah Shaikh • Edited

Highly agree!
I now got cleared about this concept while reading your comment..

Collapse
 
iftikhar profile image
iftikhar hussain

Absolutely right