How to open react native drawer in all the pages

Viewed 18

I am working on a react native drawer navigation.

When I log in to the app, drawer opens, but when I logout and login again from different user and when I click my button I get the error:

ERROR The action 'Navigation/TOGGLE_DRAWER' was not handled by any navigator.

I just want to open this drawer on all the pages.

     function DrawerRoot () {
      return (
     <Drawer.Navigator
      initialRouteName='PublicHome'
      drawerContent={(props) => <DrawerContent {...props} />}
      drawerStyle={{ width: width - 100 }}
     >
     <Drawer.Screen name='PublicHome' component={PublicHome} />
    </Drawer.Navigator>
    )
  }



  <NavigationContainer ref={navigationRef}>
    <Stack.Navigator initialRouteName='Drawer' headerMode='none'>
      <Stack.Screen name='Drawer' component={DrawerRoot} />
      <Stack.Screen name='PublicHome' component={PublicHome} options={options} />
      <Stack.Screen name='PublicJobs' component={PublicJobs} options={options} />
    </Stack.Navigator>
  </NavigationContainer>
0 Answers
Related