Based off the diagram, what happens first, the ‘render’ or the ‘componentDidMount’?
render will come before ‘componentDidMount’
What is the very first thing to happen in the lifecycle of React?
Mounting is the very first thing to occur in the lifecycle of React. Below is the flow of the Mounting phase:
Mounting Phase:
Constructor, static, getDerivedStateFromProps, render, componentDidMount, and UNSAFE_componentWillMount.
Put the following things in the order that they happen: componentDidMount, render, constructor, componentWillUnmount, React Updates
What does componentDidMount do?
This is a method that is invoked immediately after acomponent is mounted. If something is being loaded to a network request or being initiailized by the DOM then it needs to go in the componentDidMount().