This commit is contained in:
kanweiwei 2019-09-01 13:00:05 +08:00 committed by 偏右
parent bbd979f7ff
commit 784ad7d57c
2 changed files with 8 additions and 1 deletions

View File

@ -26,6 +26,13 @@ exports[`Icon \`component\` prop can access to svg defs if has children 1`] = `
/>
</linearGradient>
</defs>
<title>
Cool Home
</title>
<path
d="'M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'"
fill="scriptUrl(#gradient)"
/>
</svg>
</i>
`;

View File

@ -149,7 +149,7 @@ const Icon: IconComponent<IconProps> = props => {
const renderInnerNode = () => {
// component > children > type
if (Component) {
return <Component {...innerSvgProps} />;
return <Component {...innerSvgProps}>{children}</Component>;
}
if (children) {