diff --git a/src/components/countdown.js b/src/components/countdown.js index a71295c..c99107b 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(); } @@ -295,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() {