Home > Software design >  Invariant Violation: Picker has been removed from React Native. It can now be installed and imported
Invariant Violation: Picker has been removed from React Native. It can now be installed and imported

Time:11-18

How can i fix this problem in react native version 0.68.2

Invariant Violation: Picker has been removed from React Native. It can now be installed and imported from '@react-native-picker/picker' instead of 'react-native'. See https://github.com/react-native-picker/picker

CodePudding user response:

You should use this package because the picker was removed from react native:
https://github.com/react-native-picker/picker

Install it using

npm install @react-native-picker/picker --save

OR

yarn add @react-native-picker/picker

You can then import the Picker Element like this:

import {Picker} from '@react-native-picker/picker';

CodePudding user response:

Just try installing @react-native-picker/picker instead of just "Picker"

try this command : npm install @react-native-picker/picker --save

You can read more about it here - https://github.com/react-native-picker/picker

  • Related