mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
bugfix: fix iconfont unuseful
This commit is contained in:
parent
007da02baa
commit
6f835e6b7a
@ -30,19 +30,19 @@ export default function create(options: CustomIconOptions = {}): React.SFC<IconP
|
||||
}
|
||||
|
||||
const Iconfont: React.SFC<IconProps> = (props) => {
|
||||
const { type } = props;
|
||||
const { type, children, ...restProps } = props;
|
||||
|
||||
// component > children > type
|
||||
let content = null;
|
||||
if (props.type) {
|
||||
content = <use xlinkHref={`#${type}`} />;
|
||||
}
|
||||
if (props.children) {
|
||||
content = props.children;
|
||||
if (children) {
|
||||
content = children;
|
||||
}
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
{...restProps}
|
||||
{...extraCommonProps}
|
||||
>
|
||||
{content}
|
||||
|
Loading…
Reference in New Issue
Block a user