State Flow
2017-02-28 16:41:04 1 举报
react state update flow
作者其他创作
大纲/内容
render
MOUNTED
生命周期全局图
this.setState
componentWillUnmount
getInitialState
RECEIVE PROPS
componentDidMount
componentWillUpdate
是否处于批量更新模式
将组件保存到dirtyComponents
UNMOUNTED
RECEIVING STATE
遍历dirtyComponents调用updateComponents更新pending state or props
Y
componentDidUpdate
调用queueUpdate
shouldcomponentUpdate
newState存入pending队列
getDefaultProps
componentWillMount
N
this.setState(newState)
componentWillReceiveProps
MOUNTING
setState简化调用栈
收藏
收藏
0 条评论
下一页