Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 671 Bytes

File metadata and controls

14 lines (11 loc) · 671 Bytes

React lifecycle

  • 1- The render happens first.
  • 2- Mounting phase (constructor).
  • 3- From first to final: constructor, render, React Updates, componentDidMount, and componentWillUnmount.
  • 4- componentDidMount() is used to connect to the YouTube API and get videos when the components is rendered.

React State Vs Props

  • 1- React allows us to pass values from a parent component down to a child component. 
  • 2- Props: handle outside a component and uppdate outside a compnent. State: handle inside a component and uppdate inside a compnent.
  • 3- when the state is used.
  • 4- Counter and Forms are some examples of things that we could store in state.