react componentDidMount not firing

前端 未结 9 966
南方客
南方客 2020-12-15 14:47

I set up a new react project and for some reason, the componentDidMount method is not being called.

I have verified this behavior by placing a call to

9条回答
  •  旧巷少年郎
    2020-12-15 15:34

    For me, the reason was upper case "C" in ComponentDidMount.

    Changed it to componentDidMount and it worked

提交回复
热议问题