Bad Coder
Bad Coder

Reputation: 195

Setup an app container in App.js file in React Native

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; 

Upvotes: 0

Views: 104

Answers (0)

Related Questions