Fix issue in drawer actions (#3667)

* Fix issue in drawer actions

* Update DrawerView.js
This commit is contained in:
Eric Vicenti
2018-03-06 14:38:03 -08:00
parent 964300519d
commit 8571ce43ae
2 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -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 = () => {