React lets you define components as classes or functions. The methods that you are able to use on these are called lifecycle events. These methods can be called during the lifecycle of a component, and they allow you to update the UI and application states.
- Mounting
When an instance of a component is being created and inserted into the DOM it occurs during the mounting phase.
- Updating
Anytime a component is updated or state changes then it is rerendered. These lifecycle events happen during updating in this order.
- Unmounting
The final phase of the lifecycle if called when a component is being removed from the DOM
- Mounting
When an instance of a component is being created and inserted into the DOM it occurs during the mounting phase.
Based off the diagram, what happens first, the ‘render’ or the ‘componentDidMount’?
answer : the render then the componentDidMount
What is the very first thing to happen in the lifecycle of React?
answer : making the constructor
Put the following things in the order that they happen: componentDidMount, render, constructor, componentWillUnmount, React Updates
answer : constructor - render - React Updates - componentDidMount- componentWillUnmount
For More Info About React State Vs Props
- i'm so excited to learn more about how we use react in real web App and know more about the life cycle and i'm waiting to test the netlify website
