繁体   English   中英

找不到模块“react-select/async”的声明文件

[英]Could not find a declaration file for module 'react-select/async'

我已经安装了 react-select 3.1.0 但是当我尝试按照文档中的定义导入这个文件时,它给了我错误。

/home/.../src/core/components/kiosk/Component_file.tsx(3,25) 中的 TypeScript 错误:找不到模块“react-select/async”的声明文件。 '/home/.../node_modules/react-select/async/dist/react-select.cjs.js' 隐式具有 'any' 类型。 TS7016

导入代码行:

import AsyncSelect from 'react-select/async';

感谢您提前解决我的问题

因为我在打字稿工作。 我刚刚更改了包路径。 我用@types 作为前缀。

@types/react-select/async

您可以在 node_modules 中看到 @types 目录。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM