question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong screen transitioning when changing from one stack of screens to another different stack. (i.e authentication flow)

See original GitHub issue

Description

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

native

@react-navigation/stackcreateStackNavigator

nav

Reproduction

Here is the snack link to reproduce the issue. https://snack.expo.dev/@saad-bashar/authentication-flow

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
WoLewickicommented, Oct 18, 2021

It happens since default replaceAnimation for native-stack is pop, while default animationTypeForReplace (the same prop in stack) in stack is push. If you change this option, you should see the same behavior. Can we help you more with this?

1reaction
kacperkapusciakcommented, Oct 18, 2021

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/e947943ace33086405210e9454329be47d76478f

Could you update to the newest version and confirm that?

Cheers

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found