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> </linearGradient>
</defs> </defs>
<title>
Cool Home
</title>
<path
d="'M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'"
fill="scriptUrl(#gradient)"
/>
</svg> </svg>
</i> </i>
`; `;

View File

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