TypeError: null is not an object (evaluating 'RNGestureHandlerModule.default.Direction')

后端 未结 4 1189
悲哀的现实
悲哀的现实 2021-01-28 15:59

I have problem with module \'react-navigation-stack\' I\'ve written the same code from https://facebook.github.io/react-native/docs/navigation#react-navigation. Pla

4条回答
  •  后悔当初
    2021-01-28 16:50

    How I have solved the RNGestureHandlerModule.default.Direction error:

    1. be sure that you put that import at the top of your entry point script file

      import 'react-native-gesture-handler';
      
    2. clean Gradle

      cd ./android && ./gradlew clean && cd ..
      
    3. start the Android app with

      react-native run-android --verbose
      

    and be sure this you see that line in bundler logs:

    > Task :react-native-gesture-handler:compileDebugJavaWithJavac
    

    if you do not see it it looks like bundle did not link react-native-gesture-handler to your app.

    Especially check 1) if you have a monorepo with a mobile version index.js|tsx in one package and the whole app in another - import should be added at the top of the mobile entry point script.

提交回复
热议问题