React life cycle Methods:
Components life cycle varius Phase or stateges:
- Mounting Phase
- Updating Phase
- Unmounting Phase
Mounting Phase:
The Component first created and added to the Dom.
- constructor
- render();
- componentDidMount
ComponentDidMount:
The Component has been rendered for the first time. It is good place to perform task that need to he
done after the component has been added to the Dom.
UpdatingPhase:
This is state when the Component is removed from the Dom.
- render
- ComponentDipUpdate
This method is called after the component has been update and component state or props have changed, such as a rendering of the compoent UI.
UnMountingPhase:
This is state When the component is removed from the Dom.
ComponentWillUnmounting:
The medthod is called before the component is remvoed from the Dom. It is a good place to clean resource that the Component is usin, such as closing open sockets.
No comments:
Post a Comment