Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 975 Bytes

08.Lifecycle.md

File metadata and controls

29 lines (19 loc) · 975 Bytes

Jam3 Lessons - React

Lifecycle callbacks

For class based components, we have a set of methods available to call during its mounting, unmounting and update cycles.

This is what gets called when a component gets rendered for the first time:

  • constructor()
  • componentWillMount()
  • render()
  • componentDidMount()

When its state changes or a new prop is passed:

  • componentWillReceiveProps()
  • shouldComponentUpdate()
  • componentWillUpdate()
  • render()
  • componentDidUpdate()

Finally, before the component gets remove from the DOM componentWillUnmount() is called.

References