From c8604de75e5ee6788d3606de764a80742cc4eb8c Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 22 Aug 2025 11:43:52 -0500 Subject: [PATCH] Add fallback --- src/components/Toast/index.tsx | 4 ++++ src/components/Toast/index.web.tsx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/components/Toast/index.tsx b/src/components/Toast/index.tsx index 057dc8205b..564b97f808 100644 --- a/src/components/Toast/index.tsx +++ b/src/components/Toast/index.tsx @@ -70,5 +70,9 @@ export function show( ...options, duration: options?.duration ?? DURATION, }) + } else { + throw new Error( + `Toast can be a string or a React element, got ${typeof content}`, + ) } } diff --git a/src/components/Toast/index.web.tsx b/src/components/Toast/index.web.tsx index 29d16d67e3..ac42c11473 100644 --- a/src/components/Toast/index.web.tsx +++ b/src/components/Toast/index.web.tsx @@ -49,5 +49,9 @@ export function show( ...options, duration: options?.duration ?? DURATION, }) + } else { + throw new Error( + `Toast can be a string or a React element, got ${typeof content}`, + ) } }