我希望在页面加载时关闭抽屉。是否可以进行任何设置以隐藏页面加载时的抽屉。我正在使用react-navigation抽屉式导航器。下面是我的代码。
const AppStack = createBottomTabNavigator(
routeConfiguration,
tabBarConfiguration,
);
export default createDrawerNavigator(
{
Home: {
screen: AppStack,
},
MyProfile: {
screen: MyProfileStack,
},
About: {
screen: HelpStack,
},
},
{
// initialRouteName: 'Home',
contentComponent: SideMenu,
drawerBackgroundColor: '00FFFFF',
overlayColor: '00FFFFF',
drawerWidth: 250,
},
);
import {createAppContainer, createSwitchNavigator} from 'react-navigation';
import DrawerNavigator from './AppStack';
import {AuthStack} from './AuthStack';
const RootNav = createSwitchNavigator(
{
Drawer: DrawerNavigator,
Auth: AuthStack,
},
{
initialRouteName: 'Drawer',
},
);
export default createAppContainer(RootNav);