我今天晚上更新了material-ui的版本,现在收到打击错误:
C:/Working/boom-repository/boom-web-app/node_modules/@material-ui/core/BottomNavigation/BottomNavigation.d.ts
(4,18): Interface 'BottomNavigationProps' incorrectly extends interface 'HTMLAttributes<HTMLDivElement> & StyledComponentProps<"root"> & { className?: string | undefined;...'.
Type 'BottomNavigationProps' is not assignable to type 'HTMLAttributes<HTMLDivElement>'.
Types of property 'onChange' are incompatible.
Type '((event: ChangeEvent<{}>, value: any) => void) | undefined' is not assignable to type '((event: FormEvent<HTMLDivElement>) => void) | undefined'.
Type '(event: ChangeEvent<{}>, value: any) => void' is not assignable to type '((event: FormEvent<HTMLDivElement>) => void) | undefined'.
Type '(event: ChangeEvent<{}>, value: any) => void' is not assignable to type '(event: FormEvent<HTMLDivElement>) => void'.
我正在使用TS 3.0.1。
我已经对所有软件包执行了npm升级,清理了node_modules并重新安装了几次。我在网上发现了类似的问题,但无法找到解决方案,因此任何建议都很好。
我的问题:有人知道版本控制问题或类似问题可能导致这种情况吗?
我的packages.json如下:
{
"name": "boom-web-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^1.5.1",
"@material-ui/icons": "^2.0.3",
"animate.css": "^3.7.0",
"autosuggest-highlight": "^3.1.1",
"axios": "^0.17.1",
"bootstrap": "^3.3.7",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"jquery-slimscroll": "^1.3.8",
"node-sass-chokidar": "0.0.3",
"npm-run-all": "^4.1.3",
"prop-types": "^15.6.2",
"pubnub-react": "^1.2.0",
"qs": "^6.5.2",
"react": "^15.6.1",
"react-app-rewire-provide-plugin": "^1.0.0",
"react-app-rewired": "^1.5.2",
"react-autosuggest": "^9.4.0",
"react-block-ui": "^1.1.2",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^15.6.1",
"react-drag-sortable": "^1.0.6",
"react-dropzone": "^4.3.0",
"react-google-maps": "^9.4.5",
"react-redux": "^3.1.0",
"react-redux-toastr": "^7.4.0",
"react-router": "^4.3.1",
"react-router-bootstrap": "^0.24.2",
"react-router-dom": "^4.3.1",
"react-scripts-ts": "2.12.0",
"react-scrollbar": "^0.5.4",
"react-sortable-hoc": "^0.6.8",
"react-spinkit": "^3.0.0",
"react-stars": "^2.2.5",
"react-swipeable-views": "^0.12.16",
"react-typist": "^2.0.2",
"react-virtualized": "^9.20.1",
"reactstrap": "^5.0.0",
"recharts": "^1.1.0",
"redux": "^3.0.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"sweetalert-react": "^0.4.11",
"typesafe-actions": "^1.1.3",
"uuid": "^3.3.2"
},
"scripts": {
"build-css": "node-sass-chokidar src/content/scss/main.scss -o src/content/css",
"watch-css": "npm run build-css && node-sass-chokidar src/content/scss/main.scss -o src/content/css --watch --recursive",
"start-js": "react-app-rewired start --scripts-version react-scripts-ts",
"start": "npm-run-all -p watch-css start-js",
"build-js": "react-app-rewired build --scripts-version react-scripts-ts",
"build": "npm-run-all build-css build-js",
"test": "react-scripts-ts test --env=jsdom",
"unit": "set CI=true&&react-scripts-ts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"@types/jest": "^22.2.3",
"@types/node": "^9.6.28",
"@types/react": "^16.4.11",
"@types/react-dom": "^16.0.7",
"@types/react-redux": "^5.0.21"
},
"proxy": "http://localhost"
}