小编Jav*_*ier的帖子

不变违规:尝试注册两个同名的视图 RNCSafeAreaProvider,js 引擎:hermes

当尝试从“react-native-gifted-chat”导入和使用 GiftedChat 组件时,我收到此错误:

Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider, js engine: hermes

我已经尝试过这里列出的几件事。人们似乎对与“react-native-safe-area-context”相关的其他软件包也有类似的问题。

  • 我已经更新了“react-native-safe-area-context”(本文发布时为 4.2.5)
  • 卸载了“react-native-safe-area-context”
    • rm 节点模块
    • rm -rf ios/Pods && ios/Podfile.lock
    • rm package-lock.json
    • npm 安装
    • 重新安装 pods -> npx pod-install
    • 再次build项目还是同样的错误

我没有使用 expo,但我使用的是 React Native CLI。

在我看来,问题出在“react-native-gifted-chat”上。

细节:

  • “反应本机”:“0.66.4”
  • “反应本机安全区域上下文”:“^3.1.9”
  • “react-native-gifted-chat”:“^1.0.0”

如果有人有任何想法或见解,我将不胜感激。如果我找到解决方案,我会将其作为评论发布。

react-native react-native-gifted-chat react-native-safe-area-view

7
推荐指数
1
解决办法
3478
查看次数