首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >错误:不变违反: requireNativeComponent:"RNCPicker“未在UIManager中找到

错误:不变违反: requireNativeComponent:"RNCPicker“未在UIManager中找到
EN

Stack Overflow用户
提问于 2021-05-15 19:57:35
回答 5查看 3K关注 0票数 1

概述:

我使用TypeScript构建了一个NPM库,从上次更新它到现在已经将近9个月了(我没有时间)。但是,它使用以下库:

  1. 反应-固有模态
  2. @react本地采摘者/采摘者 (以前是@react本地-社区/采摘者,但那个库现在被弃用,转而支持新的库)
  3. @react本机-社区/日期选择器

我的图书馆(react-native-ultimate-modal-picker) package.json**:**

上面列出的所有3个库都被设置为peerDependencies,但我不确定是否遗漏了像podfiles这样的其他库。

代码语言:javascript
运行
复制
"peerDependencies": {
  "@react-native-community/datetimepicker": ">=3.0.0",
  "@react-native-picker/picker": ">=1.8.3",
  "react": "*",
  "react-native": "*",
  "react-native-modal": ">=11.0.0"
},

什么工作:

代码在iOS模拟器中运行时工作,但是当将my 反应-本机-最终-模态选择器添加到项目中时,它会出现错误。

错误:

代码语言:javascript
运行
复制
Error: Invariant Violation: requireNativeComponent: "RNCPicker" was not found in the UIManager.

将NPM库导入项目:

代码语言:javascript
运行
复制
import { DropdownList } from 'react-native-ultimate-modal-picker';

const testItems: Array<PickerValue> = [
  { label: '1', value: '1' },
];

<DropdownList
  title="Test"
  items={testItems}
  onChange={(value: string) => console.log(value)}
/>

Github (我的图书馆目前无法工作)

https://github.com/jefelewis/react-native-ultimate-modal-picker

问题的可能原因:

  • podfiles
  • 缓存?
  • NPM图书馆建设/输出不当?
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67550740

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档