mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
type(Tag): add React.ReactNode (#43357)
This commit is contained in:
parent
87a4bc882e
commit
893b5285c0
@ -117,9 +117,9 @@ const InternalTag: React.ForwardRefRenderFunction<HTMLSpanElement, TagProps> = (
|
||||
typeof props.onClick === 'function' ||
|
||||
(children && (children as React.ReactElement<any>).type === 'a');
|
||||
|
||||
const iconNode = icon || null;
|
||||
const iconNode: React.ReactNode = icon || null;
|
||||
|
||||
const kids = iconNode ? (
|
||||
const kids: React.ReactNode = iconNode ? (
|
||||
<>
|
||||
{iconNode}
|
||||
<span>{children}</span>
|
||||
@ -128,7 +128,7 @@ const InternalTag: React.ForwardRefRenderFunction<HTMLSpanElement, TagProps> = (
|
||||
children
|
||||
);
|
||||
|
||||
const tagNode = (
|
||||
const tagNode: React.ReactNode = (
|
||||
<span {...props} ref={ref} className={tagClassName} style={tagStyle}>
|
||||
{kids}
|
||||
{closeIconNode}
|
||||
|
Loading…
Reference in New Issue
Block a user