React.js component life cycle, state behavior and asynchronous nature of JavaScript

前端 未结 3 614
天命终不由人
天命终不由人 2021-01-21 14:57

I have an issue with the expected result and the actual result. Even though the fetchData() and fetchnumberOfCommits() methods are called from the

3条回答
  •  终归单人心
    2021-01-21 15:50

    As stated above you should remove it from componentWillMount as that has been deprecated as of 16.3. Should be able to drop it into a componentDidMount and it will work for you.

提交回复
热议问题