概述:
我使用TypeScript构建了一个NPM库,从上次更新它到现在已经将近9个月了(我没有时间)。但是,它使用以下库:
我的图书馆(react-native-ultimate-modal-picker) package.json
**:**
上面列出的所有3个库都被设置为peerDependencies
,但我不确定是否遗漏了像podfiles
这样的其他库。
"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 反应-本机-最终-模态选择器添加到项目中时,它会出现错误。
错误:
Error: Invariant Violation: requireNativeComponent: "RNCPicker" was not found in the UIManager.
将NPM库导入项目:
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
https://stackoverflow.com/questions/67550740
复制相似问题