react-native-picker-select
react-native-picker-select copied to clipboard
Not Woking with 0.64(Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager)
Describe the bug
Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager
To Reproduce
Steps to reproduce the behavior:
<View style={styles.container}>
<Text>Home Page</Text>
<RNPickerSelect
onValueChange={value => console.log(value)}
useNativeAndroidPickerStyle={false}
items={[
{label: 'Football', value: 'football'},
{label: 'Baseball', value: 'baseball'},
{label: 'Hockey', value: 'hockey'},
]}
/>
</View>
"dependencies": {
"react": "17.0.1",
"react-native": "0.64.0",
"react-native-picker-select": "^8.0.4"
},
I have the same issue in React Native version 0.64
I have the same issue in RN 0.63.3
I have also a issue with Android RN 0.64.1. I have this issue also with @react-native-picker/picker
I think on my side there is an issue on RN. I come from a screen with a FlatList and a stickyHeader and navigate to a detail screen where the picker is placed. After removing the stickyHeader everything works fine again.
i have the same problem in version 0.62.2, but just with the expo
You need to install @react-native-community/picker to fix the error.
You need to install @react-native-community/picker to fix the error.
It's deprecated.
You need to install @react-native-community/picker to fix the error.
It's deprecated.
It becomes @react-native-picker/picker now https://github.com/react-native-picker/picker
install @react-native-picker/picker it will remove that error , work for me.
didn't work for me either! RN version 0.66.0
Had to patch-package the import in library and install "@react-native-picker/picker" manually. Kinda hacky, but w/e.
diff --git a/node_modules/react-native-picker-select/src/index.js b/node_modules/react-native-picker-select/src/index.js
index 994440f..63aab8a 100644
--- a/node_modules/react-native-picker-select/src/index.js
+++ b/node_modules/react-native-picker-select/src/index.js
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import { Keyboard, Modal, Platform, Text, TextInput, TouchableOpacity, View } from 'react-native';
import PropTypes from 'prop-types';
import isEqual from 'lodash.isequal';
-import { Picker } from '@react-native-community/picker';
+import {Picker} from '@react-native-picker/picker';
import { defaultStyles } from './styles';
export default class RNPickerSelect extends PureComponent {
Installing https://github.com/react-native-picker/picker fixes the issue
@sagarv1997 thanks but do you know why this resolves the issue? The package.json inside the dependency (i.e. react-native-picker-select) already has that package.
I am actually looking for a way to resolve it without adding this line (lest someone removes it because npx depcheck
says the package is unused).