Component

Lifecycle

Objectives

  • Describe the component lifecycle methods

  • Describe use cases for lifecycle methods

Lifecycle Methods

Mounting

constructor()

componentWillMount()

render()

componentDidMount()

Lifecycle Methods

Unmounting

componentWillUnmount

Lifecycle Methods

Updating

componentWillReceiveProps(nextProps)

shouldComponentUpdate(nextProps, nextState)

componentWillUpdate(nextProps, nextState)

render()

componentDidUpdate(prevProps, prevState)

Forcing Update

Updating

forceUpdate(callback)

Skips shouldComponentUpdate and forces a render.  Should be avoided in most cases.

Lifecycle Methods