reading-notes

States and Props

  1. Based off the diagram, what happens first, the ‘render’ or the ‘componentDidMount’?
  1. 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
  2. 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
  3. What does componentDidMount do?
    • the method is invoked immediately after a component is mounted
    • if you need to load anything it should go there