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

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

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

11条回答
  •  粉色の甜心
    2020-11-27 10:51

    I got the same error when I was calling

    this.handleClick = this.handleClick.bind(this);
    

    in my constructor when handleClick didn't exist

    (I had erased it and had accidentally left the "this" binding statement in my constructor).

    Solution = remove the "this" binding statement.

提交回复
热议问题