Skip to content

Commit a725d27

Browse files
authored
Merge pull request react-navigation#285 from eriveltonelias/source
add how determine if the drawer is open or closed
2 parents a129f4c + 083a052 commit a725d27

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/drawer-based-navigation.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,10 @@ this.props.navigation.dispatch(DrawerActions.openDrawer());
8484
this.props.navigation.dispatch(DrawerActions.closeDrawer());
8585
this.props.navigation.dispatch(DrawerActions.toggleDrawer());
8686
```
87+
88+
If you would like to determine if drawer is open or closed, you can do the following:
89+
90+
```js
91+
const parent = this.props.navigation.dangerouslyGetParent();
92+
const isDrawerOpen = parent && parent.state && parent.state.isDrawerOpen;
93+
```

0 commit comments

Comments
 (0)