react-navigation-addons icon indicating copy to clipboard operation
react-navigation-addons copied to clipboard

Unmounted screen gets momentarily remounted

Open tmaly1980 opened this issue 8 years ago • 1 comments

I'm noticing simply by using this package via enabling enhance(StackNavigator), that when I reset to a new screen, the old screen unmounts, then gets momentarily re-constructed, mounted, rendered and then unmounted again, after the new screen starts it's process. This causes problems with using componentWillMount() to handle redux/API data retrieval.... If I remove the 'enhance' from the navigation, everything works fine with no side-effects. I've included a sample project to show this behavior:

https://github.com/tmaly1980/TestNavApp

You'll notice that after Test2Screen is mounted, there's a NEW Test1Screen that is instantiated (after the original is unmounted), only to be unmounted immediately. I generate/echo random numbers in the component state to show this. The side effect will show up in the console.log/debugger (it's not visible but it's enough to screw up any redux calls tied to the mounted components).

Here's a sample console.log (I've marked where I press on the GOTO link with a manual log entry):

screen shot 2017-07-13 at 11 07 01 am 2

Unfortunately, this is a showstopper for my (real) app and I'm going to have to switch to wix react-native-navigation to get my app out.

tmaly1980 avatar Jul 13 '17 15:07 tmaly1980

can confirm this behavior! used a forked version of this module in order to get the navigation.goBack method to work with a single-screen animation (as opposed to the various animated screens it currently does) and was about to celebrate finally getting all my navigation issues settled until I noticed my NavigationAction.reset's on user logout was causing the screens to unmount/mount/unmount again causing a whole bunch of redux actions to trigger...

eballeste avatar Dec 09 '17 00:12 eballeste