1

I am new in react native. I have a tab named 'Contacts' and I want to open drawer when user clicks on it. This below code opens the drawer screens when i clicked on the 'Contacts' tab. But i want to open Navigation Drawer.

Thank you so much in advance...

const Tabs = createMaterialBottomTabNavigator();
export default function bottomTab(){
return(
<NavigationContainer>
      <Tabs.Navigator tabBarOptions={{activeTintColor:'#4267B2'}} >
            <Tabs.Screen name="Home" component={Home} />
            <Tabs.Screen name= "Contacts" component={DrawerNavigation}/>
      </Tabs.Navigator>
</NavigationContainer>
)
}

const Drawer = createDrawerNavigator();

const DrawerNavigation = () => {
   return(
     <Drawer.Navigator>
         <Drawer.Screen name="Setting" component={Setting}/>
         <Drawer.Screen name="Notification" component={Notification}/>
     </Drawer.Navigator>
   )
 }
Neel Jadav
  • 11
  • 2

1 Answers1

0

Basically you need to use the following:

navigation.openDrawer();

If it not helping you show code of what you have already done and it will be easier to help.

D10S
  • 1,468
  • 2
  • 7
  • 13