mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-10 09:13:43 +08:00
Fix issue in drawer actions (#3667)
* Fix issue in drawer actions * Update DrawerView.js
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user