我正在尝试在我的React项目中使用react-dropdown-input
库。
(https://www.npmjs.com/package/reaect-dropdown-input(
我使用了npm i react-dropdown-input
并安装了。
但是当我运行项目时,我会遇到此错误:
错误in ./~/react-dropdown-input/index.js
找不到模块:错误:
无法在'path node_modules react-dropdown中解析'react/addons' - 输入'
这也是如此
错误中的错误 找不到模块:错误:
无法解析'react/lib/joinclasses'in'path node_modules react-dropdown-input'
我还尝试运行此命令:npm install @types/react-dropdown-input
,但该库不存在。
这是我的进口行:
import DropdownInput from "react-dropdown-input";
在我的代码中,它还说明了:
Could not find a declaration file for module 'react-dropdown-input'.
有人知道为什么会发生这种情况以及如何解决此问题?
通过npm@6.4.1,node@10.13.0进行了测试。它失败了。
我尝试克隆它。看起来图书馆没有维护。它的最后一个提交大约是5年前。您可以查看React Autosuggest。它提供了您要寻找的确切功能。
希望这会有所帮助。