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 (
+
+
+
+ );
+ })}
);
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 (
+
+
+
+ );
+ })}
);