1

Issue Description

It is not clear how screens can be unregistered. When using redux, it seems that when using startSingleScreenApp and startTabBasedApp, the initial screen from which the app is triggered remains in memory, which causes it to continue receiving props when (I assume) the screen is supposed to be released.

Steps to Reproduce / Code Snippets / Screenshots

  1. startSingleScreenApp - login screen
  2. startTabBasedApp - home screen when logged in (expect login screen to be removed from stack)
  3. startSingleScreenApp - login screen (expect home screen to be removed (expect home screen to be removed, and not to duplicate instantiation of the login screen))

How do I fix this?

html_programmer
  • 18,126
  • 18
  • 85
  • 158

1 Answers1

0

I fixed the problem by implementing shouldComponentUpdate in the login screen. It doesn't feel like a solid solution but it works. I'm not really in favour of keeping unused screen lingering in memory though.

For logging out, I guess that the way to go is to pop the 'home' screen from the stack.

html_programmer
  • 18,126
  • 18
  • 85
  • 158
  • The native component (Controller on iOS, Layout on Android) is cleared when a screen is no longer in use. It's your responsibility to clear refs and unregister listeners in `componentWillUnmount`. – guy.gc Apr 01 '18 at 06:22