简体   繁体   English

不变违规:选择器已从 React Native 中删除。 现在可以从 '@react-native-picker 安装和导入它

[英]Invariant Violation: Picker has been removed from React Native. It can now be installed and imported from '@react-native-picker

How can i fix this problem in react native version 0.68.2我如何在 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

You should use this package because the picker was removed from react native:您应该使用这个 package 因为选择器已从本机反应中删除:
https://github.com/react-native-picker/picker 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:然后您可以像这样导入 Picker 元素:

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

Just try installing @react-native-picker/picker instead of just "Picker"只需尝试安装 @react-native-picker/picker 而不仅仅是“Picker”

try this command: npm install @react-native-picker/picker --save试试这个命令:npm install @react-native-picker/picker --save

You can read more about it here - https://github.com/react-native-picker/picker您可以在这里阅读更多相关信息 - https://github.com/react-native-picker/picker

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Picker 已从 React Native 中移除。 现在可以从“@react-native-picker/picker”安装和导入它 - Picker has been removed from React Native. It can now be installed and imported from '@react-native-picker/picker' 不变违规:ViewPropTypes 已从 React Native 中移除 - Invariant Violation: ViewPropTypes has been removed from React Native 我该如何解决这个错误 Invariant Violation: ViewPropTypes has been removed from React Native - How can i fix this error Invariant Violation: ViewPropTypes has been removed from React Native 在 React Native 中使用 react-navigation v6 的 Auth Flow 出现问题。 错误:无效的挂钩调用。 不变违规:“main”尚未注册 - Issue with Auth Flow using react-navigation v6 in React Native. Error: Invalid hook call. Invariant Violation: "main" has not been registered 反应本机不变违反错误 - React native invariant violation error React Native - 不变违规“RNDateTimePicker” - React Native - Invariant Violation "RNDateTimePicker" React-Native Expo 应用程序突然无法运行,因为 Invariant Violation: 'main' has not been registered - React-Native Expo app suddenly will not run because of Invariant Violation: 'main' has not been registered React Native Picker ArrayIndexOutOfBoundsException - React Native Picker ArrayIndexOutOfBoundsExeception React Native 选择器占位符 - React Native Picker Placeholder 反应本机图像选择器 - React Native Image Picker
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM