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

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

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

11条回答
  •  感情败类
    2020-11-27 10:41

    The problem is certainly the this binding while rending the button with onClick handler. The solution is to use arrow function while calling action handler while rendering. Like this: onClick={ () => this.handleButtonChange(false) }

提交回复
热议问题