The navigation.navigate() method can't navigate to the desired screen
See original GitHub issueStructure of the router
NativeStackNavigator
Screen #1
Screen #2
Screen #3
BottomTabNavigator
Tab #1
NativeStackNavigator
Screen #5 (default)
Screen #4
Tab #2
NativeStackNavigator
Screen #6
After using props.navigation.navigate(...)
from the Screen #2
component I was expecting to open Screen #4
inside Tab #1
.
// Called from Screen #2
props.navigation.navigate('Screen #3', {
screen: 'Tab #1',
params: {
screen: 'Screen #4',
},
});
The actual result:
- App navigates to the
Screen #4
. - then, app navigates back to the
Screen #5
(which is default) - App tries to navigate back to the
Screen #4
(which was desired) - App navigates back to the
Screen #5
- After that, I manually try to navigate to the
Screen #4
, theScreen #4
is opening, but there is no back button in the header, and I able only navigate back by using swipe back gesture.
The package.json
"@react-native-community/masked-view": "0.1.6",
"@react-navigation/bottom-tabs": "^5.5.1",
"@react-navigation/native": "^5.5.0",
"@react-navigation/stack": "^5.4.1",
"react-native-screens": "^2.8.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-gesture-handler": "~1.6.0",
"react-native-reanimated": "~1.7.0",
"react-native-safe-area-context": "0.7.3",
"react-native-screens": "^2.8.0",
Platform: iPhone X (Software version 13.5)
P.S. See the attachment below to see the issue. (video)
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Moving between screens - React Navigation
Said another way, we can only navigate to routes that have been defined on our navigator — we cannot navigate to an arbitrary...
Read more >Can't navigate between screen on react-navigation 5
The trouble is on the last i have tried. I am trying to navigate From HomeScreen to DetailScreen with a custom component (kind...
Read more >A guide to React Native Navigation - LogRocket Blog
In this guide, learn how to enable different types of navigation in your React Native apps by building an example e-commerce application.
Read more >A fix for “Navigation action cannot be found in the current ...
The crash occurs because the first invocation of findController.navigate() takes the app to a different screen/destination, on the second ...
Read more >Navigating with Compose - Android Developers
The code on this page isn't type-safe. You can call the navigate() function with inexisting routes or incorrect arguments. However, you can structure...
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 FreeTop 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
Top GitHub Comments
push worked for me you are a fife saver
@WoLewicki, I’ve updated to the Expo SDK 38 and issue disappear.
Thank you a lot.