我是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]
答案 0 :(得分:6)
没有为react-bootstrap-modal安装范围类型定义 尝试安装它们:
npm install --save-dev @types/node
npm install --save @types/react-bootstrap
包的键入版本由DefinitelyTyped维护, 开源社区。 (适用于Typescript 2.0+) https://github.com/DefinitelyTyped/DefinitelyTyped