States and Props
- Based off the diagram, what happens first, the ‘render’ or the ‘componentDidMount’?
- Render happens first. The render phase is pure and has no side effects
- may be paused, aborted, or restarted by react
- What is the very first thing to happen in the lifecycle of React?
- The very first thing to happen is the mounting phase.
- When an instance or a component is made it happens during the mounting phase
- Put the following things in the order that they happen: componentDidMount, render, constructor, componentWillUnmount, React Updates
- componentDidMount
- render,
- constructor,
- componentWillUnmount,
- React Updates
- Constructor
- static
- getDerivedStateFromProps
- render-React updates
- componentDidMount
- UNSAFE_componentWillMount
- What does componentDidMount do?
- the method is invoked immediately after a component is mounted
- if you need to load anything it should go there