Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 2.08 KB

class2.md

File metadata and controls

38 lines (29 loc) · 2.08 KB

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 is the first tihng to happen
  3. Put the following things in the order that they happen: componentDidMount, render, constructor, componentWillUnmount, React Updates

    • constructor, render, componentDidMount, reactupdates componentWillUnmount
  4. What does componentDidMount do?

    • loads things usaing a network or initializing the DOM.

[React State Vs Props]

https://www.youtube.com/watch?v=IYvD9oBCuJI&ab_channel=WebDevSimplified

  1. What types of things can you pass in the props?

    • you can pass information such as the inital count in a counter imponent. how you want you component to render, such as an item with a title and sub title.
  2. What is the big difference between props and state?

    • props you pass into a component where state is inside of the component already. State can be updated inside of the component where props can be updadted outside of the component
  3. When do we re-render our application?

    • when you alter the state then it will rerender the component.
  4. What are some examples of things that we could store in state?

    • Props are useful to display something that is not hard coded.
    • state is useful when you need to use data that is going to be altered by user input, such as a form.

Bookmark and Review

React Docs - State and Lifecycle React Docs - handling events React Tutorial through ‘Developer Tools’ React Bootstrap Documentation Boootstrap Cheatsheet Bootstrap Shuffle - a class “sandbox” Netlify