[英]Picker has been removed from React Native. It can now be installed and imported from '@react-native-picker/picker'
[英]Invariant Violation: Picker has been removed from React Native. It can now be installed and imported from '@react-native-picker
我如何在 React Native 版本 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
您应该使用这个 package 因为选择器已从本机反应中删除:
https://github.com/react-native-picker/picker
安装它使用
npm install @react-native-picker/picker --save
或者
yarn add @react-native-picker/picker
然后您可以像这样导入 Picker 元素:
import {Picker} from '@react-native-picker/picker';
只需尝试安装 @react-native-picker/picker 而不仅仅是“Picker”
试试这个命令:npm install @react-native-picker/picker --save
您可以在这里阅读更多相关信息 - https://github.com/react-native-picker/picker
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.