gpt4 book ai didi

react-native - 减弱通过 UIManager ['getConstants' 直接从 UIManager 访问 View 管理器配置]

转载 作者:行者123 更新时间:2023-12-01 03:05:40 26 4
gpt4 key购买 nike

我在我的 react native expo 应用程序中遇到了这个警告。我还附上了我的 package.json文件代码。请让我知道它的解决方案。谢谢

Accessing view manager configs directly off UIManager via UIManager['getConstants'] is no longer supported. Use UIManager.getViewManagerConfig('getConstants') instead. - node_modules\react-native\Libraries\YellowBox\YellowBox.js:67:8 in warn - node_modules\expo\build\environment\muteWarnings.fx.js:17:23 in warn - node_modules\react-native\Libraries\ReactNative\UIManager.js:164:12 in get - node_modules\react-native\Libraries\Utilities\defineLazyObjectProperty.js:42:18 in getValue - node_modules\react-native-gesture-handler\createHandler.js:39:2 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-native-gesture-handler\NativeViewGestureHandler.js:3:0 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-native-gesture-handler\createNativeWrapper.js:3:0 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-native-gesture-handler\GestureHandler.js:1:0 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-native-gesture-handler\Swipeable.js:10:0 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-native-gesture-handler\index.js:1:0 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-navigation-stack\lib\module\views\StackView\StackViewLayout.js:1:942 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-navigation-stack\lib\module\views\StackView\StackView.js:1:670 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-navigation-stack\lib\module\navigators\createStackNavigator.js:1:122 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\react-navigation-stack\lib\module\index.js:1:35 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation * App.js:3:0 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\expo\AppEntry.js:4:0 in - node_modules\metro\src\lib\polyfills\require.js:331:6 in loadModuleImplementation - node_modules\metro\src\lib\polyfills\require.js:197:45 in guardedLoadModule * null:null in global code



包.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "^34.0.1",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
"react-native-gesture-handler": "~1.3.0",
"react-native-web": "^0.11.4",
"react-navigation": "^4.0.2",
"react-navigation-stack": "^1.5.4"
},
"devDependencies": {
"babel-preset-expo": "^6.0.0"
},
"private": true
}

最佳答案

尝试使用 1.3.0 版本的 react-native-gesture-handler。

    "dependencies": {
"react-native-gesture-handler": "^1.3.0",
},

在终端中输入下面给出的代码进行安装:
    npm install react-native-gesture-handler@1.3.0

它对我有用。

关于react-native - 减弱通过 UIManager ['getConstants' 直接从 UIManager 访问 View 管理器配置],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57971658/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com