reading-notes

My reading notes journal for Code Fellows

View the Project on GitHub

*Readings: 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? Constructor.
  3. Put the following things in the order that they happen: -componentDidMount, -render, -constructor, -componentWillUnmount, -React Updates. Constructor, render, componentDidMount, React updates, componentWillUnmount.
  4. What does componentDidMount do? Load anything using a network request or initialize the Dom. Like connecting Youtube API and get videos when the components are rendered.

React State Vs Props

  1. What types of things can you pass in the props? What you pass to your function. What you want to initialize your component too. What you want you competent to render like.
  2. What is the big difference between props and state? State is something inside of the component as opposed to props which are handled outside of the component.
  3. When do we re-render our application? When you change the state inside of your component.
  4. What are some examples of things that we could store in state? A counter, a form, check box, select box.

Used as Reference

https://medium.com/@joshuablankenshipnola/react-component-lifecycle-events-cb77e670a093 https://www.youtube.com/watch?v=IYvD9oBCuJI