Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 742 Bytes

23_lifecyle.md

File metadata and controls

33 lines (27 loc) · 742 Bytes

2.3 Lifecyle

  1. Instantiation

1.1 The lifecycle methods that are called the first time an instance is created

  • getDefaultProps
  • getInitialState
  • componentWillMount
  • render
  • componentDidMount

1.2 For all subsequent uses of that component class:

  • getInitialState
  • componentWillMount
  • render
  • componentDidMount”
  1. Lifetime
  • componentWillReceiveProps
  • shouldComponentUpdate // return true|false
    shouldComponentUpdate(nextProps, nextState) {
      return nextProps.id !== this.props.id;
    }
  • componentWillUpdate //not called for the initial render
  • render
  • componentDidUpdate
  1. Teardown & cleanup
  • componentWillUnmount