In componentDidMount, you can call a function using setInterval, and you can't access the properties of state in the called function.

call the runGame function using setInterval in componentDidMount

runGame:
:
constructor():

Mar.07,2021

setInterval(this.runGame.bind(this), 1000);
Menu