gpt4 book ai didi

react-native - TypeError : (0, _reactNativeScreens.useScreens) 不是函数

转载 作者:行者123 更新时间:2023-12-04 13:11:06 24 4
gpt4 key购买 nike

我搜索了这个错误,但没有找到解决方案。

TypeError: (0, _reactNativeScreens.useScreens) is not a function. (In '(0, _reactNativeScreens.useScreens)()', '(0, _reactNativeScreens.useScreens)' is undefined)
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

首先我得到这个错误``` 错误:错误:无法从 node_modules\react-native-stack\src\NavigatorIos\index.js 解析模块 react-native-screens:react-native - 在项目中找不到屏幕。


After this error I installed
```npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view```

I am trying to run in android.

最佳答案

方法useScreens已弃用,请使用 enableScreens反而。请按照以下步骤操作:

<强>1。安装依赖

expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view

或者只是 expo install react-native-screens

<强>2。替换导入

旧:import { useScreens } from 'react-native-screens';

新:import { enableScreens } from 'react-native-screens';

<强>3。替换函数

旧:useScreens();

新:enableScreens();

附言如需更多信息 click here .

关于react-native - TypeError : (0, _reactNativeScreens.useScreens) 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65148694/

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