(React) this.setState(current=>--current.number) works but this.setState(current=>current.number-1) won't work

前端 未结 0 1919
陌清茗
陌清茗 2021-02-03 20:55
class App extends React.Component{
  state = {
    number:0
  };
  ADD = ()=>{
    this.setState({number:++this.state.number})
         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题