react-router typescript错误

时间:2017-01-14 14:27:52

标签: javascript reactjs typescript redux

尝试使用react和typescript初始化路由器,但会出现大量错误

Errors

我已尝试安装npm install @types/history 但没有改变 希望你的帮助。 谢谢

我的packge.json

"dependencies": {
"@types/lodash": "^4.14.50",
"@types/react": "^0.14.55",
"@types/react-dom": "^0.14.19",
"@types/redux-form": "^6.3.2",
"animate": "^1.0.0",
"animate.css": "^3.5.2",
"bootstrap": "^4.0.0-alpha.5",
"node-sass": "^4.1.1",
"postcss-smart-import": "^0.6.6",
"react": "^15.4.1",
"react-dom": "^15.4.1",
"react-redux": "^5.0.2",
"react-router": "^3.0.1",
"redux": "^3.6.0",
"redux-form": "^6.4.3",
"typings": "^2.1.0"
},

 "devDependencies": {
    "@types/history": "^4.5.0",
    "@types/react-router": "^2.0.44",
    "awesome-typescript-loader": "^3.0.0-beta.17",
    "css-loader": "^0.26.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.9.0",
    "postcss-loader": "^1.2.1",
    "precss": "^1.4.0",
    "react-hot-loader": "^1.3.1",
    "redux-devtools": "^3.3.1",
    "resolve-url-loader": "^1.6.1",
    "sass-loader": "^4.1.1",
    "source-map-loader": "^0.1.5",
    "style-loader": "^0.13.1",
    "typescript": "^2.1.4",
    "webpack": "^1.14.0"
  }

1 个答案:

答案 0 :(得分:1)

暂时有同样的问题我复制了DefinitelyTyped历史v2的内容

https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/history/v2

进入我的node_modues / @ types / history文件夹