From b6f7ba5ca7354b566775657db2be172354beafe9 Mon Sep 17 00:00:00 2001 From: mutu Date: Tue, 30 Jul 2024 16:36:10 +0800 Subject: [PATCH] style: fix ts type error --- packages/gi-common-components/src/Icon/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {