Closed M3BIONIX closed 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); ... }
componentDidMount(){
...
this.appState = AppState.addEventListener('change', this._handleAppStateChange);
}
and the
componentWillUnmount(){ ... this.appState.remove(); ... }
componentWillUnmount(){
this.appState.remove();
here "..." means the other code which are in these functions
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