Module 无法从节点\模块typescript导入带有的react-tap事件插件
我正在努力学习react和打字脚本。并希望包括在我的项目。在那个主页上,我被指示安装react-tap事件插件,我已经安装了,并且“node_模块/react-tap事件插件”确实存在 现在我应该这样做:Module 无法从节点\模块typescript导入带有的react-tap事件插件,module,typescript,Module,Typescript,我正在努力学习react和打字脚本。并希望包括在我的项目。在那个主页上,我被指示安装react-tap事件插件,我已经安装了,并且“node_模块/react-tap事件插件”确实存在 现在我应该这样做: import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); 但是typescript编译告诉我,它找不到模块 我尝试了不同的变体(使用require、导入node_mdules/…),但
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();
但是typescript编译告诉我,它找不到模块
我尝试了不同的变体(使用require、导入node_mdules/…),但没有任何效果
如何正确设置此项
这是my package.json:
{
"private": true,
"scripts": {
"dev": "lite-server"
},
"dependencies": {
"react": "^0.14.0",
"react-dom": "^0.14.0",
"fbjs": "^0.2.1",
"react-tap-event-plugin": "0.2.0",
"material-ui": "^0.14.0"
}
}
您需要为反应点击事件插件安装。您可以通过执行以下操作来执行此操作:
- 如果您没有安装
打字
npm安装打字--global
typings安装dt~react-tap事件插件——保存
另外,请确保在
tsconfig.json
中引用typings/index.d.ts
节点模块文件夹中是否也有d.ts文件?该命令已过时。我们应该像这样安装打字:typings install dt~react tap event plugin——save