问题
i install material ui@next and i have this error in node modules.
ERROR in [at-loader] ./node_modules/material-ui/Avatar/Avatar.d.ts:8:15
11:31:52 web.1 | TS2315: Type 'ReactType' is not generic.
11:31:52 web.1 | ERROR in [at-loader] ./node_modules/material-ui/Button/Button.d.ts:7:15
11:31:52 web.1 | TS2315: Type 'ReactType' is not generic.
11:31:52 web.1 | ERROR in [at-loader] ./node_modules/material-ui/ButtonBase/ButtonBase.d.ts:10:15
11:31:52 web.1 | webpack: Failed to compile.
回答1:
Do an npm update @types/react
.
In the latest version ReactType is generic
回答2:
I fixed this by deleting my node_modules
folder and my yarn.lock
file and then reinstalling modules with yarn
(or npm i
).
After reinstalling I had a newer version of react and @types/react, which fixes this issue.
来源:https://stackoverflow.com/questions/48148533/type-reacttype-is-not-generic-material-uinext