Closed furrykef closed 6 years ago
timer = () => window.setTimeout(this.makeRandomMove, 1000);
clearTimeout(timer())
timer is a function so I believe it's correct to call it with parenthesis
if it wasn't a function
timer = window.setTimeout(this.makeRandomMove, 1000);
clearTimeout(timer)
Whoops, I completely misunderstood what's going on. Never mind! My apologies.
RandomVsRandom.componentWillUnmount has the line
window.clearTimeout(this.timer())
. Surely that should bethis.timer
, without the parentheses? Here's a fixed version: https://codesandbox.io/s/9q198jzz3wThis bug also exists in the git repository.