Skip to content Skip to sidebar Skip to footer

React-native Drawernavigator Menu On Both Sides

I have a react native app with a DrawerNavigator. For the menu I have my own component. That works great. Now I want to add a second side menu on the right side. Is it possible to

Solution 1:

you can add any drawer you want, take a look at this exemple https://snack.expo.io/BJoChzewM

In your case, you may add your "MainNavigator" in another DrawerNavigator Component. don't forget to set drawerOpenRoute/drawerCloseRoute to prevent any side effects.

Solution 2:

@KamleshKatpara Here is my solution (I nested the two navigators):

constDrawerExample=DrawerNavigator(
    {
        Home: {
            path:'/',
            screen:Home
        }
    },
    {
        initialRouteName:'Home',
        drawerPosition:'left',
        contentComponent:SidebarMenu
    }
);constMainDrawerExample=DrawerNavigator({Drafts: {
        screen:DrawerExample,
    }
}, {
    drawerPosition:'right',
    contentComponent:BookmarkMenu,
    drawerOpenRoute:'DrawerRightOpen',
    drawerCloseRoute:'DrawerRightClose',
    drawerToggleRoute:'DrawerRightToggle'
});

Post a Comment for "React-native Drawernavigator Menu On Both Sides"