Skip to content

Commit 08b25d4

Browse files
committed
add drawer actions
1 parent 47cd106 commit 08b25d4

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

docs/drawer-actions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
id: drawer-actions
3+
title: DrawerActions reference
4+
sidebar_label: DrawerActions
5+
---
6+
7+
`DrawerActions` is an object containing methods for generating actions specific to drawer-based navigators. Its methods expand upon the actions available in [NavigationActions](navigation-actions.html).
8+
9+
The following actions are supported:
10+
* [openDrawer](#openDrawer) - open the drawer
11+
* [closeDrawer](#closeDrawer) - close the drawer
12+
* [toggleDrawer](#toggleDrawer) - toggle the state, ie. switche from closed to open and vice versa
13+
14+
### Usage
15+
16+
```js
17+
import { DrawerActions } from 'react-navigation-drawer';
18+
19+
this.props.navigation.dispatch(DrawerActions.toggleDrawer())
20+
```

website/i18n/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
"customize-transitions": "customize-transitions",
3535
"deep-linking": "Deep linking",
3636
"Deep linking": "Deep linking",
37+
"drawer-actions": "DrawerActions reference",
38+
"DrawerActions": "DrawerActions",
3739
"drawer-based-navigation": "Drawer navigation",
3840
"Drawer navigation": "Drawer navigation",
3941
"drawer-navigator": "createDrawerNavigator",

website/sidebars.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"navigation-prop",
5151
"navigation-actions",
5252
"stack-actions",
53+
"drawer-actions",
5354
"stack-navigator",
5455
"switch-navigator",
5556
"drawer-navigator",

0 commit comments

Comments
 (0)