我是使用npm並在Visual Studio中作出反應的新手。試圖爲我的React項目安裝Material-UI @,但在運行項目時收到這些警告。在Visual Studio中安裝material-ui反應項目
[at-loader] ./node_modules/material-ui/ButtonBase/ButtonBase.d.ts:12:11
TS2694: Namespace 'React' has no exported member 'ButtonHTMLAttributes'.
[at-loader] ./node_modules/material-ui/ButtonBase/ButtonBase.d.ts:13:9
TS2694: Namespace 'React' has no exported member 'AnchorHTMLAttributes'.
[at-loader] ./node_modules/material-ui/Chip/Chip.d.ts:4:18
TS2430: Interface 'ChipProps' incorrectly extends interface 'HTMLAttributes<HTMLDivElement>'.
Types of property 'label' are incompatible.
Type 'ReactNode' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.
[at-loader] ./node_modules/material-ui/Form/FormControl.d.ts:5:17
TS2694: Namespace 'React' has no exported member 'HtmlHTMLAttributes'.
[at-loader] ./node_modules/material-ui/Form/FormControlLabel.d.ts:13:11
TS2694: Namespace 'React' has no exported member 'LabelHTMLAttributes'.
...
明顯的東西我失蹤?
您是否使用AMD模塊加載器(即CommonJS或RequireJS)?... – War10ck
不,我不這麼認爲。我正在使用webpack打包js文件。該項目基於Visual Studio模板「React.js和Redux」,迄今爲止唯一的變化是添加Material-UI。 – Rob
什麼版本的visual studio? –