reading-notes

My reading notes


Project maintained by brandomoki Hosted on GitHub Pages — Theme by mattgraham

State and Props

React Lifecycle

  1. Based off the diagram, what happens first, the ‘render’ or the ‘componentDidMount’?
    • render
  2. What is the very first thing to happen in the lifecycle of React?
    • Mounting
  3. Put the following things in the order that they happen: componentDidMount, render, constructor, componentDidMount, React Updates
    • constructor
    • render
    • React Updates
    • componentDidMount
    • componentDidMount
  4. What does componentDidMount do?
    • allows you to execute code when the component is already placed in the DOM

React State Vs Props

  1. What types of things can you pass in the props?
    • calbacks, arguments
  2. What is the big difference between props and state?
    • state is handled inside the component and Props are handled outside
  3. When do we re-render our application?
    • when we change state
  4. What are some examples of things that we could store in state?
    • user input, form value