Overriding with classes in material-ui v1.0.0-beta-1 shows “the key provided to the classes property is not implemented” warning

血红的双手。 提交于 2019-12-01 06:13:14
ckuijjer

Thanks to @kybarg who helped me on Material-UI's Gitter I know how to fix this, see the CodeSandbox he made to help me.

The warning occurs because the classes property will next to the root key also contain a .MyButton-root-p:hover property which the Button obviously doesn't support. To solve this make sure you only pass the supported keys to the Button, for example by:

export default withStyles(buttonStyle)(({ classes, ...restProps}) => (
  <Button classes={{ root: classes.root }} {...restProps} />
));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!