InterviewSolution
| 1. |
Explain the new lifecycle methods in React 16.3? |
|
Answer» There are two new lifecycle methods introduced in React 16.3. Their main TASK is replacing the old error-prone lifecycle methods like componentWillUpdate and componentWillReceiveProps. You can still use these old lifecycle methods in your project but only till React 17 is released. These old lifecycle methods are now called - UNSAFE_componentWillUpdate and UNSAFE_componentWillReceiveProps. static getDerivedStateFromProps(nextProps, prevState) getSnapshotBeforeUpdate(prevProps, prevState) So, the new ORDER of mounting is -
The order of update caused by changes in any props or state is -
|
|