Error: "Another navigator is already registered for this container. You likely have multiple navigators under a single Navigation Container"

Viewed 125

I am trying to add a second drawer to my current navigator, but I am getting an error that states that I am already using another navigator in this stack. This drawer navigator will be on the opposite side of the existing one and open to the right instead of the left, and also have different screens for users to navigate to.

<NavigationContainer>
{getAuth() ? (
<React.Fragment>
<Drawer.Navigator drawerContent={props => <DrawerContent {...props}/>}
screenOptions = {{
  gestureEnabled: false,
}}>

<Drawer.Screen name="HomeDrawer" component={MainTabScreen}/> 
...
</Drawer.Navigator>

  <Drawer2.Navigator drawerContent={props => <Drawer2Content {...props}/>}
    screenOptions = {{
     gestureEnabled: false,
  }}>
<Drawer2.Screen name - "HomeDrawer" component={MainTabScreen}/>
</Drawer2.Navigator>
)

  :
  <RootStackScreen/>
}

</NavigationContainer>
0 Answers
Related