diff --git a/src/views/Drawer/DrawerSidebar.js b/src/views/Drawer/DrawerSidebar.js index 65aa4c4345..4f7935f6b6 100644 --- a/src/views/Drawer/DrawerSidebar.js +++ b/src/views/Drawer/DrawerSidebar.js @@ -45,7 +45,6 @@ class DrawerSidebar extends React.PureComponent { }; _onItemPress = ({ route, focused }) => { - this.props.navigation.navigate('DrawerClose'); if (!focused) { let subAction; // if the child screen is a StackRouter then always navigate to its first screen (see #1914) diff --git a/src/views/Drawer/DrawerView.js b/src/views/Drawer/DrawerView.js index 613484bf42..72eaa8687f 100644 --- a/src/views/Drawer/DrawerView.js +++ b/src/views/Drawer/DrawerView.js @@ -4,6 +4,7 @@ import DrawerLayout from 'react-native-drawer-layout-polyfill'; import addNavigationHelpers from '../../addNavigationHelpers'; import DrawerSidebar from './DrawerSidebar'; +import NavigationActions from '../../NavigationActions'; /** * Component that renders the drawer. @@ -36,12 +37,12 @@ export default class DrawerView extends React.PureComponent { _handleDrawerOpen = () => { const { navigation } = this.props; - navigation.dispatch({ type: 'DrawerOpenAction' }); + navigation.dispatch({ type: NavigationActions.OPEN_DRAWER }); }; _handleDrawerClose = () => { const { navigation } = this.props; - navigation.dispatch({ type: 'DrawerCloseAction' }); + navigation.dispatch({ type: NavigationActions.CLOSE_DRAWER }); }; _updateWidth = () => {