Current behavior
I have a bottom tab navigator which contains two tabs, home and menu, which each contain a stack navigator to handle multiple pages. Menu contains 2 screens, catalog and search, where catalog is the initial screen. If initial params (of any kind, even an empty object) are provided, then if you navigate to search, close search, navigate away from menu, and navigate back to it, search will reappear. If you do not provide initial params, then search will not reappear. This only happens when navigating with the format navigate($tabName, {screen: $screenName}).
The behavior is shown in the repro, one tab is given initial params of {} and the other is given none. One will save the screen, the other will not.
Expected behavior
I expect the tab navigator to not regenerate a closed tab when inital params are provided.
Reproduction
https://snack.expo.dev/M574fTBn08bklhl6cV_qb
Platform
Packages
Environment
- [] I've removed the packages that I don't use
| package |
version |
| @react-navigation/native |
^6.0.8 |
| @react-navigation/bottom-tabs |
^6.0.9 |
| @react-navigation/native-stack |
^6.7.0 |
| react-native-safe-area-context |
^4.4.1 |
| react-native-screens |
^3.19.0 |
| react-native |
^0.71.7 |
| node |
20.15.1 |
| yarn |
1.22.22 |
Current behavior
I have a bottom tab navigator which contains two tabs, home and menu, which each contain a stack navigator to handle multiple pages. Menu contains 2 screens, catalog and search, where catalog is the initial screen. If initial params (of any kind, even an empty object) are provided, then if you navigate to search, close search, navigate away from menu, and navigate back to it, search will reappear. If you do not provide initial params, then search will not reappear. This only happens when navigating with the format navigate($tabName, {screen: $screenName}).
The behavior is shown in the repro, one tab is given initial params of
{}and the other is given none. One will save the screen, the other will not.Expected behavior
I expect the tab navigator to not regenerate a closed tab when inital params are provided.
Reproduction
https://snack.expo.dev/M574fTBn08bklhl6cV_qb
Platform
Packages
Environment