我的选项卡中有bottomTabNavigator,每个选项卡内都有堆栈。每当我单击另一个选项卡时,我都想重置堆栈。
选项卡导航器-
选项卡 1 - |_堆栈导航器
- Screen 1
- Screen 2
选项卡 2 - |_堆栈导航器
- Screen 3
- Screen 4
选项卡 3 - |_堆栈导航器
- 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-navigation/bottom -tabs”:“^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 ", },