How to use react-jss with MaterialUI 4?

只愿长相守 提交于 2019-12-06 15:48:57

You can use:

"react-jss": "10.0.0-alpha.16"

https://github.com/cssinjs/react-jss is archived because of it being restructured to be part of the jss monorepo (multiple packages in one GitHub repository): https://github.com/cssinjs/jss/tree/master/packages/react-jss.

Whenever you upgrade Material-UI, you should check to see if the jss version in Material-UI has changed so that you can stay in sync; otherwise you'll be pulling in two versions of jss. You can check the Material-UI jss version here: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-styles/package.json#L48

You should also look into whether you need to be using react-jss directly vs. just using the jss wrappers in Material-UI (e.g. withStyles, makeStyles, etc.).

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