我有一个很大的问题,要使用graphql(react-apollo)和material-ui为完整的React应用程序制作样板。我尝试了很多,但我总是遇到同样的问题:
Warning: Prop "className" did not match. Server: "MuiSvgIcon-root-60 MuiListItemIcon-root-127" Client: "MuiSvgIcon-root-60 MuiListItemIcon-root-123"
如果我已登录(问题显然来自抽屉组件),并且:
Warning: Did not expect server HTML to contain a <h1> in <div>.
如果我要注销(抽屉未显示)。
您可以在此处找到完整的示例:https : //github.com/CocoJr/docker-sf4-elasticsearch-graphql-react-express/tree/master/volumes/node
这是我的server.js文件:https : //github.com/CocoJr/docker-sf4-elasticsearch-graphql-react-express/blob/master/volumes/node/src/server.js
谢谢很多人。
我解决了我的错误:
https://github.com/mui-org/material-ui/issues/10649#issuecomment-408624288
只需在bash中使用它就可以正常工作: sed -i 's/material-ui\/core\/SvgIcon/material-ui\/core\/es\/SvgIcon/' 'node_modules/@material-ui/icons/es/utils/createSvgIcon.js'
并确保始终使用/ es版本的material-ui,尤其是@ viii / material-ui / icons / ... => @ material-ui / icons / es / ...附带的SvgIcon。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句