The React Component Lifecycle has three phases. While rendering the component it goes through the mouting,updating and unmounting phases
Now the order of the methods of execution in each lifecycles are in particular order such as
The react component life cycle
- Component is being created and inserted into the DOM.\
- Methods execution in following order
- An update can be caused by changes to props or state.
- Any state or prop defined in the component changes it happen in this lifecycles.
- The order of the execution of the component is as follow
- This method is called when a component is being removed from the DOM:
- only one method on unmounting is as follow