Skip to main content
Version: 7.x

DrawerActions reference

DrawerActions is an object containing methods for generating actions specific to drawer-based navigators. Its methods expand upon the actions available in CommonActions.

The following actions are supported:

openDrawer

The openDrawer action can be used to open the drawer pane.

navigation.dispatch(DrawerActions.openDrawer());
Try on Snack

closeDrawer

The closeDrawer action can be used to close the drawer pane.

navigation.dispatch(DrawerActions.closeDrawer());
Try on Snack

toggleDrawer

The toggleDrawer action can be used to open the drawer pane if closed, or close if open.

navigation.dispatch(DrawerActions.toggleDrawer());
Try on Snack

jumpTo

The jumpTo action can be used to jump to an existing route in the drawer navigator.

  • name - string - Name of the route to jump to.
  • params - object - Screen params to pass to the destination route.
navigation.dispatch(jumpToAction);
Try on Snack