我在主页堆栈中有3个屏幕,在设置堆栈中有1个屏幕。我想在主页堆栈中隐藏2个屏幕的bottomtabnavigator。到目前为止,hometab的每个屏幕都将出现bottomtabnavigator。这是我的代码:-
const navOptionHandler = () => ({
headerShown: false,
});
function HomeStack() {
return (
<View style={styles.container}>
<Stack.Navigator initialRouteName="Login">
<Stack.Screen
name="Login"
component={LoginScreen}
options={navOptionHandler}
/>
<Stack.Screen
name="SignUp"
component={SignupScreen}
options={navOptionHandler}
/>
<Stack.Screen
name="Home"
component={HomeScreen}
options={navOptionHandler}
/>
</Stack.Navigator>
</View>
);
}
function SettingStack() {
return (
<Stack.Navigator initialRouteName="Setting">
<Stack.Screen
name="Setting"
component={SettingsScreen}
options={navOptionHandler}
/>
</Stack.Navigator>
);
}
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator>
<Tab.Screen name="Home" component={HomeStack} />
<Tab.Screen name="My Profile" component={SettingStack} />
</Tab.Navigator>
</NavigationContainer>
);
}