RN Navigation - Draw Navigator

Asked

Viewed 132 times

0

My app will feature various types of navigation on different screens. I started using index with stacknavigator and a second page trying to configure Drawnavigator and I’m not getting.

I saw in an example post as if I had to start and register the app with the draw first. That’s right?

  • It would be interesting if you indicate which post you saw this too.

  • In this one: https://developerlife.com/2017/04/15/navigation-and-styling-with-react-native/

1 answer

0


I managed using with Stack and Drawer. In my case Drawer is the first screen of the Stack and it works. The code is like this:

const Drawer = DrawerNavigator({
  HomeDrawer: {
    screen: HomeScreen
  },
  SettingsDrawer:{
    screen: SettingsScreen
  }
});
const App = StackNavigator({
  Drawer: {
    screen: Drawer,
  },
  Home: {
    screen: HomeScreen
  },
  Settings: {
    screen: SettingsScreen
  },
  View: { screen: ViewScreen },
})

export default App;

In this case Home and Settings are accessible from Drawer and view is only accessible from the stack.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.