ReactJS: Warning: setState(…): Cannot update during an existing state transition

后端 未结 11 1115
一个人的身影
一个人的身影 2020-11-27 10:32

I am trying to refactor the following code from my render view:

11条回答
  •  一整个雨季
    2020-11-27 11:01

    That usually happens when you call

    onClick={this.handleButton()} - notice the () instead of:

    onClick={this.handleButton} - notice here we are not calling the function when we initialize it

提交回复
热议问题