From f0204bd9e17b736ed6b1e8c055884899a0549691 Mon Sep 17 00:00:00 2001 From: Riku Ayanokoji Date: Mon, 17 Jul 2017 16:08:06 +0800 Subject: [PATCH] fix: use window.setTimeout instead of setTimeout Node.js' setTimeout returns entire Timer object and after upgrade the TypeScript considered setTimeout returns NodeJS.Timer object instead of a number. Changing to use window.setTimeout to distinguish with Node.js. See more details: https://github.com/Microsoft/TypeScript/issues/842 --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index b8b6835..d0d440e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -21,7 +21,7 @@ export default class extends React.Component { let {i} = this.state; i++; this.setState({i}); - this.tickToken = setTimeout(this.tick, 800); + this.tickToken = window.setTimeout(this.tick, 800); }; render() {