-
Notifications
You must be signed in to change notification settings - Fork 0
6. Drawer
Erik Poort edited this page May 3, 2018
·
3 revisions
The syntax to show a drawer is a bit different. You have a center view which is required and a left and right view, which are optional.
navigation.start(
<DrawerView id="hamburger"
left={<SingleView id="home" screen={Home} />}
center={<SingleView id="home" screen={Home} />}
right={<SingleView id="home" screen={Home} />}
/>
);
Calls are navigator type specific, so you should access them that way as well.
It doesn't make sense to call 'push' on a tabbar, so these calls are split up.
You can access the navigation via the props:
this.props.drawer
Because you can nest navigation types, you can also access the navigator by its id (in the example above 'hamburger'):
this.props.hamburger
This is a call with which you can change any of sides of the menu. For example, add this to a menu (left or right side) that opens a page in the center view:
this.props.drawer.openView("center", <SingleView id="home" screen={Home} />);
Feel free to open any other type of navigation!