diff --git a/packages/gi-common-components/src/Icon/index.tsx b/packages/gi-common-components/src/Icon/index.tsx index acbdb005e..8e65a1084 100644 --- a/packages/gi-common-components/src/Icon/index.tsx +++ b/packages/gi-common-components/src/Icon/index.tsx @@ -2,7 +2,7 @@ import IconFont, { createFromIconfontCN } from '@ant-design/icons'; import Graphin from '@antv/graphin'; -import React from 'react'; +import React, { ElementType } from 'react'; import { loadFontJson, loadUnicodeFont, type FontJson } from './loader'; export const fontFamily = 'iconfont'; @@ -69,7 +69,7 @@ interface IconProps extends React.HTMLProps { /** * @reference https://github.com/ant-design/ant-design-icons/blob/master/packages/icons-react/src/components/IconFont.tsx */ -export const Icon = React.forwardRef((props, ref) => { +export const Icon: ElementType = React.forwardRef((props, ref) => { const { type, children, ...restProps } = props; let content: React.ReactNode = null; if (props.type) {