首页 > 解决方案 > 每当安装 React Native Gesture Handler 它开始给出错误

问题描述

我正在使用反应导航安装反应导航,但是当我安装时npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view,它开始在 iOS 中给我错误。

错误是Use of undeclared identifier 'UIScrollTypeMaskAll'RNPanHandler.m

我遵循文档的所有步骤。

Xcode 版本:- 11.3.1

反应本机手势处理程序版本:- 1.9.0

我也试过这个: -

1.

   import 'react-native-gesture-handler'; //by adding on top
   import * as React from 'react';
   import { NavigationContainer } from '@react-navigation/native';

   export default function App() {
      return (
        <NavigationContainer>{/* Rest of your app code */}</NavigationContainer>
      );
     }
  1. rm -rf node_modules并删除package-lock.json
  2. 将 React 本机手势处理程序与 React 本机手势处理程序分开安装
  3. pod install

标签: iosreactjsreact-nativereact-navigation

解决方案


这里已经提到了这个问题,

https://github.com/software-mansion/react-native-gesture-handler/issues/1235

尝试将您的 XCode 版本升级到 12.2 或尝试将您的 React Native Gesture Handler 版本升级到 1.8.0


推荐阅读