reactjs - 在React js中出现错误: Could not find a declaration file for module 'react-bootstrap-modal' .

标签 reactjs

我是reactjs新手,我已经安装了npm install react-bootstrap-modal 当我将它与 var Modal = require('react-bootstrap-modal') 一起使用时,它给出了下面的错误,任何人都可以帮我解决这个问题吗?

Could not find a declaration file for module 'react-bootstrap-modal'. 'd:/wamp64/www/my-app/node_modules/react-bootstrap-modal/lib/Modal.js' implicitly has an 'any' type.Try `npm install @types/react-bootstrap-modal` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-bootstrap-modal';` [7016]

Try `npm install @types/react-bootstrap-modal` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-bootstrap-modal';` [7016]

最佳答案

没有为react-bootstrap-modal安装作用域类型定义 尝试安装它们:

npm install --save-dev @types/node 
npm install --save @types/react-bootstrap

Typed version of packages are maintained by DefinitelyTyped, an open source community. (For Typescript 2.0+) https://github.com/DefinitelyTyped/DefinitelyTyped

关于reactjs - 在React js中出现错误: Could not find a declaration file for module 'react-bootstrap-modal' .,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54158852/

相关文章:

javascript - 完美滚动条错误没有指定元素来初始化Windows上的PerfectScrollbar

javascript - (React ES6) 动态添加模态触发器到 map 标记

javascript - 有没有比 forceUpdate() 更好的解决方案

javascript - 在 React 应用程序中重定向用户的最佳实践是什么?

Facebook 社交插件评论部分被类名 Conceal (ReactJS)

javascript - 如何识别 ReactJS Material-UI 中所选 <MenuItem/> 的主要文本?

javascript - 引用错误 : localStorage is not defined in ReactJS Build

javascript - 使用 React v0.14.3 的 React 路由器

javascript - 使用lodash groupBy函数对数组中的对象进行分类

javascript - 带有参数导航返回的 React Router 需要双击