簡體   English   中英

React-native:requireNativeComponent:升級到最新版本后在 UIManager 中找不到“RNGestureHandlerRootView”

[英]React-native: requireNativeComponent: "RNGestureHandlerRootView" was not found in the UIManager after upgrading to latest version react native

我剛剛將我的 React Native 項目 (CLI) 從 0.66.1 升級到 0.70.6。 我在iOS上運行完美,但是在android上運行時出現這個錯誤。[在此處輸入圖像描述 ]. 我的 package.json:

"react-native": "0.70.6",
"react": "18.1.0",
"react-native-safe-area-context": "^4.4.1",
 "react-native-screens": "^3.18.2",
   "@react-native-masked-view/masked-view": "^0.2.8",
    "@react-navigation/bottom-tabs": "^6.4.3",
    "@react-navigation/drawer": "^6.5.1",
    "@react-navigation/material-top-tabs": "^5.3.15",
    "@react-navigation/native": "^6.0.14",
    "@react-navigation/native-stack": "^6.9.2",
    "@react-navigation/stack": "^6.3.5",

我該如何解決這個問題? 請幫忙

最近我遇到了同樣的問題。 這是解決方案:

您需要添加 react-native-gesture-handler

yarn add react-native-gesture-handler or npm install react-native-gesture-handler

並將其添加到 App.js

import 'react-native-gesture-handler';

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM