From 4821cfcb48c61bd86410063c6aec9afabf591636 Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Tue, 9 Nov 2021 15:07:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20generateIcon=20?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BC=A0=E5=85=A5=20jsx.element=20=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E6=97=B6=E7=9A=84=E6=8A=A5=E9=94=99=20(#2890)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/icon.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/icon.tsx b/src/utils/icon.tsx index a3b57f94c..653351958 100644 --- a/src/utils/icon.tsx +++ b/src/utils/icon.tsx @@ -17,6 +17,10 @@ export const generateIcon = ( className?: string, classNameProp?: string ) => { + if (React.isValidElement(icon)) { + return icon; + } + const isURLIcon = icon?.indexOf('.') !== -1; return icon ? (