I'm relatively new to web development and am currently studying Reactjs.
My question is regarding this code. This is found on the React.js website, here specifically: State and Lifecycle - React
this.timerID = setInterval(
() => this.tick(),
1000
);
}
I'm wondering why this.tick()
has to be returned. instead of just setInterval(this.tick(), 1000)
. I tried this, and of course didn't work.