From 63287b26aba60ece36736f25d25b83a7ab2fbdc0 Mon Sep 17 00:00:00 2001 From: Andy Edwards Date: Thu, 12 Apr 2018 10:51:02 -0500 Subject: [PATCH] fix(interval): restart timer when timeout changes fix #139 --- packages/interval/src/Component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/interval/src/Component.js b/packages/interval/src/Component.js index 217deaf..c29e38b 100644 --- a/packages/interval/src/Component.js +++ b/packages/interval/src/Component.js @@ -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 {