在抽屉导航中隐藏页面加载时的抽屉

时间:2019-11-24 06:21:17

标签: react-native react-navigation

我希望在页面加载时关闭抽屉。是否可以进行任何设置以隐藏页面加载时的抽屉。我正在使用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);

0 个答案:

没有答案