You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very rarely and seemingly randomly, when using props.navigation.goBack(), the GO_BACK action is replaced by NAVIGATE one.
Using dynamic configuration with @react-navigation v7 + backBehavior: ‘history’.
Navigation structure is as follow:
BOTTOM-TABS
NATIVE_STACK A
LIST_SCREEN + DETAILS_SCREEN
NATIVE_STACK B
LIST_SCREEN + DETAILS_SCREEN
NATIVE_STACK C
LIST_SCREEN + DETAILS_SCREEN
NATIVE_STACK D
LIST_SCREEN + DETAILS_SCREEN
When following actions’ order like so:
1 Load app, get navigated to NATIVE_STACK A (LIST_SCREEN)
2 Using bottom tab, navigate to NATIVE_STACK C (LIST_SCREEN)
3 Open the DETAILS_SCREEN for one of the items
4 Press hardware back button or icon triggering props.navigation.goBack()
5 Observe navigation correctly going back to NATIVE_STACK C’s LIST_SCREEN
6 Repeat steps 3&4 (open details -> go back) until the bug occurs
7 Observe navigation having been set to NATIVE_STACK D’s LIST_SCREEN
After the error occurs, when navigating to the NATIVE_STACK C using bottom tab, one can observe the DETAILS_SCREEN has not been removed.
Additionally, listener added to the beforeRemove event does not trigger when trying to goBack when the error occurs.
The issue happens in all the stacks where user tries to trigger the back navigation - can happen in NATIVE_STACKs A,B or C. When the bug occurs, the user is always navigated to the last stack in the bottom tab navigator.
Expected behavior
props.navigation.goBack should always result in navigating back, rather than randomly navigating to another stack within the bottom tab navigator
A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.
Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.
You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro.
Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.
Current behavior
Very rarely and seemingly randomly, when using
props.navigation.goBack()
, theGO_BACK
action is replaced byNAVIGATE
one.Using dynamic configuration with
@react-navigation v7
+backBehavior: ‘history’
.Navigation structure is as follow:
When following actions’ order like so:
After the error occurs, when navigating to the NATIVE_STACK C using bottom tab, one can observe the DETAILS_SCREEN has not been removed.
Additionally, listener added to the
beforeRemove
event does not trigger when trying togoBack
when the error occurs.The issue happens in all the stacks where user tries to trigger the back navigation - can happen in
NATIVE_STACKs A,B or C
. When the bug occurs, the user is always navigated to the last stack in the bottom tab navigator.Expected behavior
props.navigation.goBack
should always result in navigating back, rather than randomly navigating to another stack within the bottom tab navigatorReproduction
Platform
Packages
Environment
"@react-navigation/bottom-tabs": "^7.0.0-alpha.8",
"@react-navigation/devtools": "^6.0.25",
"@react-navigation/native": "^7.0.0-alpha.7",
"@react-navigation/native-stack": "^7.0.0-alpha.12",
"react-native": "0.73.6",
The text was updated successfully, but these errors were encountered: