[英]Failed prop type: Invalid prop openIcon supplied to CardHeader, expected a ReactNode
I am trying to use Material-UI and create a CardHeader with custom open and close icons (openIcon, closeIcon). 我正在尝试使用Material-UI并使用自定义打开和关闭图标(openIcon,closeIcon)创建CardHeader。 I have tried sever different approaches to create the custom icons. 我尝试了多种方法来创建自定义图标。 However I keep getting the error: Failed prop type: Invalid prop openIcon supplied to CardHeader, expected a ReactNode
. 但是我不断收到错误: Failed prop type: Invalid prop openIcon supplied to CardHeader, expected a ReactNode
。 I have been searching for documentation identifying how to define openIcon and closeIcon however i have not been able to find anything. 我一直在寻找标识如何定义openIcon和closeIcon的文档,但是我却找不到任何东西。 I have tried SvgIcon, FontIcon and both produce the same error. 我试过SvgIcon,FontIcon,并且都产生相同的错误。 I have have seen the information on the Card here . 我在这里看到了卡上的信息。 however it only specifies "node" with no examples or further definitions. 但是,它仅指定“节点”,没有示例或进一步的定义。 Could someone point me in the right direction as to where this is documented. 有人可以指出我的正确方向。
I was able to figure out how to specify the openIcon and closeIcon attributes to the CardHeader 我能够弄清楚如何为CardHeader指定openIcon和closeIcon属性
openIcon={<FontIcon className="material-icons">mode_edit</FontIcon>}
I found the answer when looking at how they specified the icon in the Avatar example. 在查看他们如何在Avatar示例中指定图标时,我找到了答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.