我重新安装了我所有的node_modules在我的反应-本机项目使用纱线(删除node_modules和运行纱线)。在它完成后,我已经启动了我的应用程序,并有堆弹出以下警告:
react本机-手势处理程序似乎是在使用带有手势组件的旧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....我试着重新安装反应-本机-手势-处理程序(纱线,漫游反应-本机手势处理程序和纱添加任何东西,但这并没有改变。
发布于 2022-01-19 16:40:03
新的react-native-gesture-handler版本,如果您使用旧的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!",
]);发布于 2022-02-15 11:03:26
这个错误是荒谬的:D强制2.1.1版本。你不会再看到那个恼人的错误了:
“反应-本机-手势-处理程序”:"2.1.1",
发布于 2022-03-09 05:19:03
如果是这样,则可能由react-navigation包导致使用@react-navigation/native-stack而不是该链接中的@react-navigation/stack。
https://stackoverflow.com/questions/70756058
复制相似问题