Wrong screen transitioning when changing from one stack of screens to another different stack. (i.e authentication flow)
See original GitHub issueDescription
I am implementing the authentication flow using createNativeStackNavigator
, it works fine but when changing from auth-stack
to logged-in-stack
the screen comes from the left slide which makes it look like the screen was already there, also it shows a back button for a second where these 2 stacks are completely different.
I also checked with createStackNavigator
from @react-navigation/stack
, there the behavior is correct.
Native Stack Demo – createNativeStackNavigator
@react-navigation/stack – createStackNavigator
Reproduction
Here is the snack link to reproduce the issue. https://snack.expo.dev/@saad-bashar/authentication-flow
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Issue with authentication flow using react-navigation 5.0.5
I'm rendering a stack of screens with login screen as the initial route when user is not logged in successfully. And rendering another...
Read more >How to reset stack when switching stack for authentication ...
I want the navigation state of the regular stack to be reset when a user logs off. I have tried doing this, but...
Read more >Screen options with nested navigators
In this document we'll explain how screen options work when there are multiple navigators. It's important to understand this so that you put...
Read more >Dell Networking N-Series Switches User Guide
The Stack No. panel displays the unit number for the stack member. If a switch is not part of a stack (in other...
Read more >Cloud Monitoring for Catalyst Onboarding - Cisco Meraki
This process connects the Catalyst device to the Cisco cloud using a TLS ... switching must be used and a different network can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It happens since default
replaceAnimation
fornative-stack
ispop
, while defaultanimationTypeForReplace
(the same prop instack
) instack
ispush
. If you change this option, you should see the same behavior. Can we help you more with this?Hi @Saad-Bashar, this seems to be resolved in the latest version of
@react-navigation/native-stack
6.2.5. https://github.com/react-navigation/react-navigation/commit/e947943ace33086405210e9454329be47d76478fCould you update to the newest version and confirm that?
Cheers