我当前在导入react-dnd时遇到此错误
Could not find a declaration file for module 'react-dnd'. 'node_modules/react-dnd/lib/index.js' implicitly has an 'any' type.
Try `npm install @types/react-dnd` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-dnd';react-dnd不提供类型定义吗?要访问这些类型,我还需要做些什么吗?
我在严格模式下使用typescript。我的应用程序是用create-react-app搭建的。
发布于 2020-10-17 05:22:06
正如您在unpkg中看到的那样,react-dnd确实附带了类型定义。你不需要做任何事情来访问这些类型。也许您使用的是没有包含这些类型的react-dnd的旧版本?
https://stackoverflow.com/questions/64396235
复制相似问题