javascript - 导入 react-native 社区选择器时出错
问题描述
我是 react-native 的新手,因为我使用的是 Expo 并且必须安装 react-native 社区选择器,所以我使用以下命令进行安装:
npm install @react-native-community/picker --save
之后我像这样导入它:
import {Picker} from '@react-native-community/picker';
但我收到以下错误:
While trying to resolve module `@react-native-community/picker` from file `C:\xampp\htdocs\secondtry\screens\HomeScreen3.js`, the package `C:\xampp\htdocs\secondtry\node_modules\@react-native-community\picker\package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`C:\xampp\htdocs\secondtry\node_modules\@react-native-community\picker\js\index.js`. Indeed, none of these files exist:
解决方案
推荐阅读
- javascript - 带分页的 Ag-grid 树视图
- python-3.x - 在 selenium 中将文本发送到剪贴板
- python - 如何将 alphavantage api 响应提取到 pandas 数据框中
- javascript - React Native Navigation 将所有屏幕包裹在一个视图中
- html - 将对象(div)垂直和水平居中,无大间隙环绕
- python - 使用 pprint 函数打印前五个元素
- c# - 实例的嵌套类为空
- java - 在数组列表中按换行符分隔
- reactjs - 新手问题:如何在带有 React 和 Apollo 客户端的简单表单处理程序中正确分解代码
- c# - SQL 表没有更新,但我的 datagridview1 在运行时被来自文本框的信息填充