浅谈React Native 中组件的生命周期(2)

生命周期 调用次数 能否使用 setSate()
getDefaultProps   1(全局调用一次)   否  
getInitialState   1   否  
componentWillMount   1   是  
render   >=1   否  
componentDidMount   1   是  
componentWillReceiveProps   >=0   是  
shouldComponentUpdate   >=0   否  
componentWillUpdate   >=0   否  
componentDidUpdate   >=0   否  
componentWillUnmount   1   否  

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wygzjg.html