From 38db7196c7d3d7e1d39c521c2073cd7c14db57dd Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Thu, 9 Jun 2022 16:18:45 +0800 Subject: [PATCH] =?UTF-8?q?[issues/I5BFJT]online=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=BC=80=E5=8F=91-=E7=82=B9=E5=87=BB=E3=80=90=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=9C=B0=E5=9D=80=E3=80=91=E6=8A=A5=E9=94=99-Uncaught?= =?UTF-8?q?=20ReferenceError:=20React=20is=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/web/useMessage.tsx | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/hooks/web/useMessage.tsx b/src/hooks/web/useMessage.tsx index 06e2592..bae9cd9 100644 --- a/src/hooks/web/useMessage.tsx +++ b/src/hooks/web/useMessage.tsx @@ -35,21 +35,30 @@ interface ConfirmOptions { } function getIcon(iconType: string) { - if (iconType === 'warning') { - return ; - } else if (iconType === 'success') { - return ; - } else if (iconType === 'info') { - return ; - } else { - return ; + try { + if (iconType === 'warning') { + return ; + } else if (iconType === 'success') { + return ; + } else if (iconType === 'info') { + return ; + } else { + return ; + } + } catch(e) { + console.log(e); } } function renderContent({ content }: Pick) { - if (isString(content)) { - return
${content as string}
`}>; - } else { + try { + if (isString(content)) { + return
${content as string}
`}>; + } else { + return content; + } + } catch(e) { + console.log(e); return content; } }