setState回调

this.state = {foo: 2};
this.setState({foo: 123}, ()=> {
 console.log(foo);

});
原文地址:https://www.cnblogs.com/dianzan/p/11822283.html