From 5bca5b35fa8e43f395efe4225b81caffddb37fd7 Mon Sep 17 00:00:00 2001 From: habubey Date: Tue, 29 Nov 2022 10:26:20 +0300 Subject: [PATCH 1/2] Fix #3716: The show() method causes the browser to crash. --- components/lib/messages/Messages.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/components/lib/messages/Messages.js b/components/lib/messages/Messages.js index 8fc3bda367..01da40eadc 100644 --- a/components/lib/messages/Messages.js +++ b/components/lib/messages/Messages.js @@ -83,15 +83,16 @@ export const Messages = React.memo( return (
- {messagesState.map((message) => { - const messageRef = React.createRef(); - - return ( - - - - ); - })} + {messagesState && + messagesState.map((message) => { + const messageRef = React.createRef(); + + return ( + + + + ); + })}
); From 400a653d2a31c3256e05f5bbb41f3c7d21a4bd2b Mon Sep 17 00:00:00 2001 From: habubey Date: Tue, 29 Nov 2022 16:42:25 +0300 Subject: [PATCH 2/2] Fix #3716: Toast/Message the show() method causes the browser to crash. --- components/lib/toast/Toast.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/components/lib/toast/Toast.js b/components/lib/toast/Toast.js index 1127f8bfc2..e461ae753a 100644 --- a/components/lib/toast/Toast.js +++ b/components/lib/toast/Toast.js @@ -104,15 +104,16 @@ export const Toast = React.memo( return (
- {messagesState.map((messageInfo) => { - const messageRef = React.createRef(); - - return ( - - - - ); - })} + {messagesState && + messagesState.map((messageInfo) => { + const messageRef = React.createRef(); + + return ( + + + + ); + })}
);