0

While navigating to different screens from side menu, I hid the side menu using following code:

 Navigation.mergeOptions('Drawer', {
  sideMenu: {
    left: {
      visible: false,
    }
  }
});

The problem using this approach was change in behavior of swipe gesture. While using gesture to open the menu, it would appear for a instance and close itself. And swipe gesture would only work properly after your click the menu button.

Habi
  • 161
  • 1
  • 9

1 Answers1

0
 closeSideMenu = ( ) => {
/*For android devices*/
  if (Platform.OS === 'android') {
    /*disable swipe gesture*/
    Navigation.mergeOptions("navigation.playground.menu", {
      sideMenu: {
        left: {
          enabled: false,
        },
      },
    });
    /*enable swipe gesture*/
    Navigation.mergeOptions("navigation.playground.menu", {
      sideMenu: {
        left: {
          enabled: true,
        },
      },
    });
  } else {
    /*for iOs devices*/
    Navigation.mergeOptions("navigation.playground.menu", {
      sideMenu: {
        left: {
          visible: false,
        },
      },
    });
  }
};
Habi
  • 161
  • 1
  • 9