Type 'ReactType' is not generic (material-ui@next)

心已入冬 提交于 2019-12-10 14:13:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!