Skip to content
This repository has been archived by the owner on May 27, 2019. It is now read-only.

Commit

Permalink
fix: use window.setTimeout instead of setTimeout
Browse files Browse the repository at this point in the history
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: microsoft/TypeScript#842
  • Loading branch information
Riku Ayanokoji committed Jul 17, 2017
1 parent fc95ff6 commit f0204bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class extends React.Component<any, HelloState> {
let {i} = this.state;
i++;
this.setState({i});
this.tickToken = setTimeout(this.tick, 800);
this.tickToken = window.setTimeout(this.tick, 800);
};

render() {
Expand Down

0 comments on commit f0204bd

Please sign in to comment.