Introduction to React.js | Lifecycle methods
Lifecycle methods:
:-componentWillMount()
It is called just before the render function is called-
:-componentDidMount()
It is called just after the whole render() function is executed -
:-getDerivedSttaeFromProps()
It is used to assign or update or delete state from props -
:-componentWillUnmount()
This method is called just before the component is removed from the virtual DOM -
:-componentDidUpdate()
Tjhis is ca;led whenever the state on ject is changed -
The
, method is used to set the state variables and other normal properties of the com[ponent to defayult values which will be the initial values. It takes props as a single argumentconstructor()
Comments
Post a Comment