常规方式
this.setState({ time:this.state.time+1,})
this.setState({ time:this.state.time+2,})
相当于
this.setState(Object.assign({},{ time:this.state.time+1,},{ time:this.state.time+2,}))
prevState
this.setState(prevState=>({
time:prevState.time+1,}))
this.setState(prevState=>({
time:prevState.time+2,}))
如此写法,在react中,会形成一个队列,对所有setState依次调用