React basic grammar of life-cycle function

What is the life cycle of a function declaration: function is a function of the life cycle components at a certain moment it will be automatically executed.

 A: Mounting stage (Mounting) function to perform life cycle:

  1.  componentWillMount () == UNSAFE_componentWillMount () said: component will be executed automatically mount the stage
  2.  render () said: page content automatically executed when rendering
  3.  componentDidMount () represents: the mount assembly to complete the automatic execution

  When the page is first loaded ...

   

Two: the life cycle stages of the update function (updation) executed: props updates and states update function to perform life cycle

  1. shouldComponentUpdate () denotes: before updating function automatically performs data need to return true or false
  2. UNSAFE_componentWillUpdate () == componentWillUpdate () says: Before the update
  3. componentDidUpdate said: update complete

       

 Three: Several other periodic function declaration:

  1. componentWillReceiveProps () said: only sub-components have this life-cycle function, when the sub-assembly receives new data transfer props parent component will perform.
  2. componentWillUnmount () says: function to execute the component to be removed when

 

Guess you like

Origin www.cnblogs.com/jack-zhou21235/p/11984498.html