0

I am trying to make a login screen and after the login screen, it should take to home screen with drawer navigation. I am trying to set up the app container in the App.js file so, I am having trouble with it.

const App = () => {
  return (
    <AppContainer />
  );
}


const DrawerNavigator = createStackNavigator({
  <NavigationContainer independent = {true}>
    <Drawer.Navigator initialRouteName="">
      <Drawer.Screen name="" component = "">
      <Drawer.Screen name="" component = "">
      <Drawer.Screen name="" component = "">
    </Drawer.Navigator>
  </NavigationContainer>
})

const AuthNavigator = createStackNavigator({
  Auth: AuthScreen
})

const MainNavigator = createSwitchNavigator({
  Auth: AuthNavigator,
  AppScreen: DrawerNavigator
})

const AppContainer = createAppContainer(MainNavigator);

export default App; 
James Z
  • 12,209
  • 10
  • 24
  • 44
Bad Coder
  • 177
  • 11
  • What is the error or trouble you are having? And in `Drawer.Screen` pass the component and name you have passed empty string that might have break the app for you. – Rohit Aggarwal Sep 25 '21 at 05:08
  • App.js: Unexpected token (97:4) 95 | 96 | const DrawerNavigator = createStackNavigator({ > 97 | – Bad Coder Sep 25 '21 at 10:39
  • No, I have just deleted them for purpose. I have passed the name and component as well. It is showing the error above. – Bad Coder Sep 25 '21 at 10:40
  • I think you are using v4 of `react-navigation`. There is no `NavigationContainer` in v4. – Rohit Aggarwal Sep 25 '21 at 12:13

0 Answers0