From b2e40f36071501fdcfc7c77a97f90ede38f0a2d1 Mon Sep 17 00:00:00 2001 From: ElbarryAmine <81116690+elbarryamine@users.noreply.github.com> Date: Tue, 23 Nov 2021 13:48:11 +0100 Subject: [PATCH 1/2] useNativeDriver Need to set useNativeDriver to true Cause It Trows an error --- src/components/countdown.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/countdown.js b/src/components/countdown.js index a71295c..f717de9 100644 --- a/src/components/countdown.js +++ b/src/components/countdown.js @@ -213,6 +213,7 @@ class CountDown extends Component { toValue: 1, duration: 1000, easing: Easing.linear, + useNativeDriver: true, }).start(() => { const {seconds, minutes, hours} = this.state; if ((seconds || minutes || hours) && !this.props.pause) @@ -226,6 +227,7 @@ class CountDown extends Component { toValue: 1, duration: 1000, easing: Easing.linear, + useNativeDriver: true, }).start(); } From 32531116d008f8d62c76009daecf98d6c7dd8aaa Mon Sep 17 00:00:00 2001 From: ElbarryAmine <81116690+elbarryamine@users.noreply.github.com> Date: Tue, 23 Nov 2021 23:41:53 +0100 Subject: [PATCH 2/2] Removed deprecated function "AppState.removeEventListener" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AppState.removeEventListener is now deprecated ⛔ should use it like this now : 👉 const sub = AppState.addEventListener('event', callback); and to remove must use : 👉 sub.remove( ) --- src/components/countdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/countdown.js b/src/components/countdown.js index f717de9..c99107b 100644 --- a/src/components/countdown.js +++ b/src/components/countdown.js @@ -297,12 +297,12 @@ class CountDown extends Component { // if (this.props.endingAlert?.animate) // this.alertAnimate(); - AppState.addEventListener('change', this._handleAppStateChange); + this.subcription = AppState.addEventListener('change', this._handleAppStateChange); } componentWillUnmount() { clearInterval(this.timer); - AppState.removeEventListener('change', this._handleAppStateChange); + this.subcription.remove(); } render() {