diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index 9bd3d5505..725edd056 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -324,7 +324,7 @@ interface TimerState { secondsElapsed: number; } class Timer extends React.Component, TimerState> { - static state = { + state = { secondsElapsed: 0 } private _interval: number; diff --git a/react/react-tests.ts b/react/react-tests.ts index a9b693cab..c6f186e8b 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -324,7 +324,7 @@ interface TimerState { secondsElapsed: number; } class Timer extends React.Component<{}, TimerState> { - static state = { + state = { secondsElapsed: 0 } private _interval: number; @@ -334,8 +334,7 @@ class Timer extends React.Component<{}, TimerState> { })); } componentDidMount() { - var me = this; - this._interval = setInterval(() => me.tick(), 1000); + this._interval = setInterval(() => this.tick(), 1000); } componentWillUnmount() { clearInterval(this._interval);