4
votes

I want to open drawer and move main content to side.

example like this

enter image description here

2
Hi, did you get it?? I'm having the same requirement. Couldnt find a solutionJessy Swan

2 Answers

3
votes

In version 3.x of react-navigation you could use drawerType: 'slide'. See the following example:

const DrawerExample = createDrawerNavigator(
  {
    Inbox: {
      path: '/',
      screen: InboxStack,
    },
    Drafts: {
      path: '/sent',
      screen: DraftsStack,
    },
  },

  {
    initialRouteName: 'Drafts',
    contentOptions: {
      activeTintColor: '#e91e63',
    },
    drawerType: 'slide'
  }
);

Notice the createDrawerNavigator() instead of DrawerNavigator()

Documentation: https://reactnavigation.org/en/

-2
votes

You can create a DrawerNavigator like this

const MyApp = DrawerNavigator({
  Home: {
    screen: MyHomeScreen,
  },
  Notifications: {
    screen: MyNotificationsScreen,
  },
});

Look at this documentation

https://reactnavigation.org/docs/navigators/drawer