生命周期函数的执行顺序?
来源:4-9 React 生命周期函数的使用场景
yb笨小孩
2018-12-29


对删除c的部分,不能理解
componentWillMount() {
console.log(this.props.item + '_child componentWillMount');
}
componentDidMount() {
console.log(this.props.item + '_child componentDidMount');
}
shouldComponentUpdate(nextProps, nextState) {
console.log(this.props.item + '_child shouldComponentUpdate');
if (nextProps.item !== this.props.item) {
return true;
} else {
return false;
}
}
componentReceiveProps() {
console.log(this.props.item + '_child componentReceiveProps');
}
componentWillUpdate() {
console.log(this.props.item + '_child componentWillUpdate');
}
componentDidUpdate() {
console.log(this.props.item + '_child componentDidUpdate');
}写回答
1回答
-
Dell
2018-12-29
具体什么问题
012019-01-02
相似问题