talalmajali / react-native-countdown-component

React Native CountDown
MIT License
264 stars 233 forks source link

AppState.removeEventListener() is deprecated which is used in the index.js file #120

Closed M3BIONIX closed 1 year ago

M3BIONIX commented 1 year ago

As the removeEventListener() is deprecated in latest versions of react native, this causes a warning leading to a memory leak. This issue can be fixed by changing the index.js file replacing the

componentDidMount(){ ... this.appState = AppState.addEventListener('change', this._handleAppStateChange); ... }

and the

componentWillUnmount(){ ... this.appState.remove(); ... }

here "..." means the other code which are in these functions