peter-mach / react-navigation-is-focused-hoc

Ready to use solution using HOC to expose props.isFocused for react-navigation. No Redux needed.
MIT License
169 stars 21 forks source link

Screen still active even when app is auto killed by Android OS. #17

Closed ghost closed 6 years ago

ghost commented 6 years ago

Steps to reproduce

  1. My screen structure : Splash Screen -> Main Screen.
  2. Implement withNavigationFocusHOC in Main screen, call a method 'viewDidAppear' to update screen
  3. When press home button , the app goes to background. Due to the app consume large amount of battery it's being auto killed.
  4. When click on app, it launches again from SplashScreen. At the same time the 'viewDidAppear' function in Main Screen fires. (haven't even reached Main Screen)

Expected behaviour

withNavigationFocus HOC in Main Screen should not call when app is reloaded due to android OS auto kill app. This issue does not happen if I reload the app manually(kill and relaunch / Menu->Reload / R R)

ghost commented 6 years ago

Sorry my bad. Not this HOC , it's another component, AppState that is still active.