React in Unsafe life cycle

componentWillMount, componentWillReceiveProps, componentWillUpdate

 Unsafe: React has a BUG in future releases, especially after allows asynchronous rendering

 

Version 16.3

Three cycles to add UNSAFE_ * mark.

UNSAFE_componentWillMount, UNSAFE_componentWillReceiveProps, UNSAFE_componentWillUpdate

Version 16.9

Add or not to add the prefix UNSAFE_ *, can be used. But if you use does not add a prefix UNSAFE_ *, then the browser will issue a warning

Version 17.0

Do not add a prefix to remove UNSAFE_ * life cycle, can only be used to add a prefix UNSAFE_ * life cycle.

 

Guess you like

Origin www.cnblogs.com/lyraLee/p/11531112.html