react lifecycle hooks

instantiate

  • construtor//constructor
  • componentWillMount//Before mounting, setState can be modified
  • render//Render the real dom
  • componentDidMount//After the first render, only once, you can setState

Existence

  • componentWillReceiveProps//When the props are updated when the parent component renders, regardless of whether the props change
  • shouldComponentUpdate//It is called automatically after modifying the state. It returns true by default, and false skips the latter. Use less
  • componentWillUpdate//It is called automatically before modifying the state's render, similar to CWM
  • render
  • Called after componentDidUpdate//render, do not modify the state infinite loop as a last resort

Destruction period

  • componentWillUnmount//before destruction

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325130687&siteId=291194637