Overview:
I built an NPM library using TypeScript and it's been almost 9 months since I've last updated it (I didn't have the time). However, it uses the following libraries:
- react-native-modal
- @react-native-picker/picker (Used to be @react-native-community/picker, but that library is now deprecated in favor of the new library)
- @react-native-community/datetimepicker
My Library (react-native-ultimate-modal-picker) package.json:
I have all 3 of the listed libraries above set as peerDependencies, but I'm not sure if I'm missing something else like 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"
},
What Works:
The code works when running in the iOS Simulator, but when adding the my library react-native-ultimate-modal-picker to a project, it gives the error.
Error:
Error: Invariant Violation: requireNativeComponent: "RNCPicker" was not found in the UIManager.
Imported NPM Library into project:
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 Repo (My Library that currently isn't working)
https://github.com/jefelewis/react-native-ultimate-modal-picker
Possible Reasons For Issues:
podfiles?- Cache?
- Improper build/export of NPM library?