skip to Main Content

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

2

Answers


  1. 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';
    
    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search