①不使用回調函數,打印出來的就是this.state中的值
this.state{a:123},
this.setstate({a:345})
console.log(this.state.a) //123
使用回調函數,這個函數相當於使用生命中期中的ComponentDidupdate函數的作用
this.state(a:123,)
this.setstate({a:345},()=>{
console.log(this.state.a)
}) //345