【发布时间】:2020-04-07 05:03:18
【问题描述】:
我的标签中有bottomTabNavigator,每个标签内都有堆栈。每当我单击另一个选项卡时,我都想重置堆栈。
标签导航器-
选项卡 1 - |_Stack 导航器
- Screen 1
- Screen 2
选项卡 2 - |_堆栈导航器
- Screen 3
- Screen 4
选项卡 3 - |_Stack 导航器
- Screen 5
- Screen 6
目前的情况是,.假设我在选项卡 1 上 - 我从 screen 1 导航到 Screen 2 。然后我点击 Tab 2 。现在,如果我再次单击选项卡 1,将显示屏幕 2 而不是屏幕 1。
每个选项卡上都发生了类似的事情。
我想在每次点击标签时重置标签。
请帮忙。
我正在使用 -
“依赖”:{“@react-native-community/cli”:“^4.1.0”,“@react-native-community/masked-view”:“^0.1.6”,“@react-导航/底部标签”:“^5.0.5”、“@react-navigation/native”:“^5.0.5”、“@react-navigation/stack”:“^5.0.5”、“react”: “16.9.0”、“react-native”:“0.61.5”、“react-native-gesture-handler”:“^1.6.0”、“react-native-gifted-chat”:“^0.13.0 ", "react-native-reanimated": "^1.7.0", "react-native-safe-area-context": "^0.7.3", "react-native-screens": "^2.0.0- beta.7", },
【问题讨论】:
标签: react-native react-navigation react-navigation-stack react-navigation-v5 react-navigation-bottom-tab