Skip to content

Commit

Permalink
Fix issue in drawer actions (react-navigation#3667)
Browse files Browse the repository at this point in the history
* Fix issue in drawer actions

* Update DrawerView.js
  • Loading branch information
ericvicenti authored and sourcecode911 committed Mar 9, 2020
1 parent d673234 commit 7ecd57e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/views/Drawer/DrawerSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions src/views/Drawer/DrawerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 7ecd57e

Please sign in to comment.