react 16.3+ new life cycle operations

1, which ⽣ life cycle are discarded (3), which ⽣ life cycle is new (2)?

componentWillMount (), componentWillReceiveProps (), componentWillUpdate () is discarded, static getDerivedStateFromProps () and getSnapshotBeforeUpdate () is new

2, these ⽣ life cycle are discarded reasons or new? Using the parameters as well as new and ⽣ life cycle?

Because these older life cycle is often misunderstood and abused, the new life cycle can take full advantage of the new asynchronous nature react

3, react to get accustomed versions (1.6.3,1.6.4,1.7.0) related processes and planning ⽣ life cycle?

16.3 version: the old life-cycle method name, alias, the new name effective life-cycle approach

16.4 version: the old life-cycle method names, aliases, new life-cycle approach name is valid, but the old name will lifecycle approach warning in development mode

17.0 Version: only aliases and the new name effective life-cycle approach

4, why should getDerivedStateFromProps is designed for static Remedies?

5, getDerivedStateFromProps condition is triggered to perform to what?

Initial mount, prop updated by setState update

6, the definition of Derived state is? (How to understand the derived state?)

Derived state,

7, in 1.6.3, setState () does not cause getDerivedFromProps of Perform, ⽽ 1.6.4. Will, because?

16.4 version has been corrected to ensure compatibility with the upcoming React asynchronous rendering mode

8,1.6.2 its previous upgrade to 1.6.4 is ⽅ case?

9,1.6.x upgrade to 1.7 is ⽅ case?

Guess you like

Origin www.cnblogs.com/ruoshuisanqian/p/11260089.html