title: React Native: Active state in AppState listener getting triggered when component mounts
body: <p>I have set up a listener for AppState in React Native to know when my app switches from background to foreground so I can show a splash screen.</p>
  
  <pre><code>useEffect(() =&gt; {
  AppState.addEventListener('change', handleAppStateChange);
  },[])
  
  const handleAppStateChange = newState =&gt; {
  
      if (newState === 'active') {
        RNBootSplash.show();
      }
  
    };
  </code></pre>
  
  <p>The problem is, and this only happens when I compile a release APK, for some reason it works fine in debug, the splash screen is showing each time the component mounts, while it should only trigger when the app is switched into the active state from background. Any help?</p>
  
  <p>Using React Native 61.5</p>