0

Current Behavior

In React navigation 5

Drawer properly opens and closes on openDrawer() and closeDrawer() events, but facing issues while using swipe gesture to open drawer.

Steps to Reproduce:- 1)Open Drawer once 2)Tap outside Drawer and close. 3)Swipe to open drawer. ( Facing problem here, not able to open)

adiwon
  • 59
  • 6

1 Answers1

0

Have you followed all the installation instructions for react-native-gesture-handler?

From https://software-mansion.github.io/react-native-gesture-handler/docs/getting-started.html :

"Update your MainActivity.java file:"

package com.swmansion.gesturehandler.react.example;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;  //Add this...
import com.facebook.react.ReactRootView;  //...and this...
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; //...and this

public class MainActivity extends ReactActivity {

  @Override
  protected String getMainComponentName() {
    return "Example";
  }
//Add this function
  @Override
  protected ReactActivityDelegate createReactActivityDelegate() {
    return new ReactActivityDelegate(this, getMainComponentName()) {
      @Override
      protected ReactRootView createRootView() {
       return new RNGestureHandlerEnabledRootView(MainActivity.this);
      }
    };
  }
}


Gabriel Amorim
  • 370
  • 2
  • 13