React Native:react-native-gesture-handler:看起来像是在yarn之后使用旧的api

JaR*_*ter 5 react-native react-native-gesture-handler

我使用yarn重新安装了react-native项目中的所有node_modules(删除node_modules并运行yarn)。完成后,我启动了我的应用程序,并且突然弹出此警告:

[react-native-gesture-handler] 似乎您正在使用带有手势组件的旧 API,请查看新的手势系统!

然后它列出了很多反应原生元素(我认为),如下所示:

PanGestureHandler@http://IP/index.bundle?platform=android&dev=true&minify=false&app=com.legosocialmedia&modulesOnly=false&runModule=true:133321:38
PanGestureHandler@http://IP/index.bundle?platform=android&dev=true&minify=false&app=com.legosocialmedia&modulesOnly=false&runModule=true:132628:34
RCTView
View
AnimatedComponent@http://IP/index.bundle?platform=android&dev=true&minify=false&app=com.legosocialmedia&modulesOnly=false&runModule=true:68721:38
AnimatedComponentWrapper
RCTView
View
Card@http://IP/index.bundle?platform=android&dev=true&minify=false&app=com.legosocialmedia&modulesOnly=false&runModule=true:131894:36
CardContainer@http://IP/index.bundle?platform=android&dev=true&minify=false&app=com.legosocialmedia&modulesOnly=false&runModule=true:131451:34
RNSScreen

And so on....
Run Code Online (Sandbox Code Playgroud)

我尝试重新安装react-native-gesture-handler(yarn romovereact-native-gesture-handleryarnaddreact-native-gesture-handler),但这并没有改变任何东西。

Anr*_*che 15

如果您使用旧的 API 版本,或者您的包/库之一使用它,则新版本的react-native-gesture-handler会发送警告。

要禁用警告,您可以忽略日志。

在你的 app.js / app.tsx 中

import { LogBox } from 'react-native';

LogBox.ignoreLogs([
  "[react-native-gesture-handler] Seems like you\'re using an old API with gesture components, check out new Gestures system!",
]);
Run Code Online (Sandbox Code Playgroud)

这里有你的解释

更新

现在已修复此问题,因为:react-native-gesture-handler": "2.1.1"