简体   繁体   English

道具类型失败:提供给CardHeader的道具openIcon无效,应该是ReactNode

[英]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.

相关问题 获取错误:警告:道具类型失败:提供给“Form”的道具“children”无效,应为 ReactNode - GETTING ERROR : Warning: Failed prop type: Invalid prop `children` supplied to `Form`, expected a ReactNode reactJs:失败的道具类型:提供给“弹出”的无效道具“触发器”,需要一个ReactNode - reactJs: Failed prop type: Invalid prop `trigger` supplied to `Popup`, expected a ReactNode 警告:失败的道具类型:提供给“ForwardRef(Select)”的无效道具“children”,需要一个ReactNode - Warning: Failed prop type: Invalid prop `children` supplied to `ForwardRef(Select)`, expected a ReactNode 警告:道具类型失败:提供给“MenuItem”的道具“子项”无效,应为 ReactNode - Warning: Failed prop type: Invalid prop `children` supplied to `MenuItem`, expected a ReactNode 失败的道具类型:提供给 `ForwardRef(Select)` 的无效道具 `children`,需要一个 ReactNode - Failed prop type: Invalid prop `children` supplied to `ForwardRef(Select)`, expected a ReactNode 提供给“DropdownItem”的无效道具“children”需要一个 ReactNode - Invalid prop `children` supplied to `DropdownItem` expected a ReactNode 失败的道具类型:提供给“重定向”的无效道具“到” - Failed prop type: Invalid prop `to` supplied to `Redirect` 失败的道具类型:向“表”提供了“功能”类型的道具“ rowSelection”无效,预期是“对象” - Failed prop type: Invalid prop `rowSelection` of type `function` supplied to `Table`, expected `object` 警告:失败的道具类型:提供给“Carousel”的“object”类型的无效道具“data”,预期为“array” - Warning: Failed prop type: Invalid prop `data` of type `object` supplied to `Carousel`, expected `array` 警告:道具类型失败:提供给“Route”的“object”类型的无效道具“component”,预期为“function” - Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM