ReactNative Component 生命周期

1、创建阶段

constructor() 
componentWillMount()
render()
componentDidMount()

2、更新阶段

componentWillReceiveProps(nextProps) 
boolean shouldComponentUpdate(nextProps,nextState)
componentWillUpdate(nextProps,nextState)
render()
componentDidUpdate(prevProps,prevState)

3、销毁阶段

componentWillUnmount()

这里写图片描述

猜你喜欢

转载自blog.csdn.net/huagbo/article/details/78493451