Skip to content

Commit

Permalink
fix(interval): restart timer when timeout changes
Browse files Browse the repository at this point in the history
fix #139
  • Loading branch information
jedwards1211 authored and nkbt committed May 10, 2019
1 parent bbf0ef8 commit 92f388c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/interval/src/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export class ReactInterval extends React.Component {
);
}

componentDidUpdate({enabled}) {
if (this.props.enabled !== enabled) {
componentDidUpdate({enabled, timeout}) {
if (this.props.enabled !== enabled || this.props.timeout !== timeout) {
if (this.props.enabled) {
this.start();
} else {
Expand Down

0 comments on commit 92f388c

Please sign in to comment.