程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了react native navigation TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.handleSetJSResponder')大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决React Native navigation TypeError: null is not an object (evaluaTing '_RNGestureHandlerModule.default.handleSetJSResponder')?

开发过程中遇到React Native navigation TypeError: null is not an object (evaluaTing '_RNGestureHandlerModule.default.handleSetJSResponder')的问题如何解决?下面主要结合日常开发的经验,给出你关于React Native navigation TypeError: null is not an object (evaluaTing '_RNGestureHandlerModule.default.handleSetJSResponder')的解决方法建议,希望对你解决React Native navigation TypeError: null is not an object (evaluaTing '_RNGestureHandlerModule.default.handleSetJSResponder')有所启发或帮助;

我遵循 react-native 文档的步骤。

npx react-native init SelfApp --template react-native-template-typescript

然后按照react-native-navigation的步骤操作。

yarn add @react-navigation/native 
yarn add react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-vIEw

然后我添加代码

@R_301_5565@ 'react-native-gesture-handler';

到 app.tsx 的第一行。

然后运行 ​​yarn start,我收到此错误。

react native navigation TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.handleSetJSResponder')

我尝试了很多次,但还是有问题,这是我的 package.Json

react native navigation TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.handleSetJSResponder')

解决方法

嘿,根据 react-native-gesture-handler 的 GitHub 上的 this discussion,这要么是链接问题(如果您使用的是 Android),要么是某些 pod 未安装(如果您使用的是 iOS)的问题。

>

知道您使用的是哪个版本的 React Native 会很有帮助,因为如果 >= 60,它应该支持自动链接,如果它

在最后一种情况下: Try these steps

对于 iOS:

$ cd ios

$ pod install

根据我上面提到的讨论(参见 this specific response),另一种可能对其他人有效的解决方案:

1 - delete/Remove your node_modules directory

rm -rf node_modules

2 - Install your dependencies again

如果您使用的是 Yarn $ yarn install 或者您使用的是 npm npm install

3 Clean your Gradle

cd android
./gradlew clean
cd ..
react-native run-android

大佬总结

以上是大佬教程为你收集整理的react native navigation TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.handleSetJSResponder')全部内容,希望文章能够帮你解决react native navigation TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.handleSetJSResponder')所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。