该setState()功能运行什么?它只会运行render()吗?
setState()
render()
setState()将按以下顺序运行函数:
shouldComponentUpdate()
componentWillUpdate()
componentDidUpdate()
如果您的组件正在接收道具,它将componentWillRecieveProps()使用上述功能运行该功能。
componentWillRecieveProps()