我使用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....
我尝试重新安装react-native-gesture-handler(纱线 romove 反应本机手势处理程序 and 纱线添加反应本机手势处理程序),但这并没有改变任何事情。
新版本的,反应本机手势处理程序如果您使用旧的 API 版本,以及您的包/库之一使用它,则发送警告。
要禁用警告,您可以忽略日志。
在你的 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!",
]);
这里有你的解释 https://github.com/software-mansion/react-native-gesture-handler/pull/1817
UPDATE
现在已修复此问题,因为:react-native-gesture-handler": "2.1.1"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)