How to use the @react-navigation/routers.DrawerActions.closeDrawer function in @react-navigation/routers

To help you get started, we’ve selected a few @react-navigation/routers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-navigation / navigation-ex / packages / drawer / src / views / DrawerView.tsx View on Github external
const handleDrawerClose = () => {
    navigation.dispatch({
      ...DrawerActions.closeDrawer(),
      target: state.key,
    });

    navigation.emit({ type: 'drawerClose' });
  };
github react-navigation / navigation-ex / packages / drawer / src / views / DrawerItemList.tsx View on Github external
onPress={() => {
          navigation.dispatch({
            ...(focused
              ? DrawerActions.closeDrawer()
              : CommonActions.navigate(route.name)),
            target: state.key,
          });
        }}
      />
github react-navigation / navigation-ex / packages / drawer / src / views / DrawerSidebar.tsx View on Github external
private handleItemPress = ({
    route,
    focused,
  }: {
    route: Route;
    focused: boolean;
  }) => {
    const { state, navigation } = this.props;

    navigation.dispatch({
      ...(focused
        ? DrawerActions.closeDrawer()
        : CommonActions.navigate(route.name)),
      target: state.key,
    });
  };