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}`, + ) } }