-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After Drawer was closed replacement with StackNavigator causes duplicated mounting and animation glitch #8202
Comments
The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Issue also exists with newest dependencies. I took them from the snack instead of the local project at first. Updated the original description now. |
You should nest the navigation. Drawer into stack or stack into drawer whichever you prefer, usually people next stack inside the drawer. https://reactnavigation.org/docs/nesting-navigators/ also read this |
I changed the structure now and everything is working fine so far. Thank you for the hint 👍 |
Hello there, thank you for spending your time on this issue.
It is much appreciated 🙂
Current Behavior
In our app we have a drawer navigator within the logged in state of the app.
When logging out we switch over to a StackNavigator for the login management.
The issue is when the drawer was opened and the app switches to the login navigator, the login screen gets mounted twice also causing the switch to be animated.
How to reproduce
We simplified the project as much as possible.
Therefore we created this snack: https://snack.expo.io/@baumstumpf/drawer-to-stacknavigator-duplicated-mounting-issue
Open it on any device/simulator/emulator.
What you can see is that there are two logs of "Mounted" and one log of "Unmounted".
Also the navigation state changes two times. Both times it has the same state (it looks like).
Additional infos
We discovered that it is necessary to replace the drawer with another navigator.
It is not enough to go to a plain component.
The problem appeared after updating from:
to
We think it is related to the update of the native package from
5.0.9
to5.0.10
, but we are not 100% sure, yet.The issue seems to be not only related to the drawer, but we haven't been able to create a reproducible version for the issue in different environments yet.
Your Environment
Same behavior for Android and iOS.
Tested on multiple different versions.
Also tested different react-native versions
The text was updated successfully, but these errors were encountered: