diff --git a/src/components/toast-icon.tsx b/src/components/toast-icon.tsx index 34e4c38..b6ddd3b 100644 --- a/src/components/toast-icon.tsx +++ b/src/components/toast-icon.tsx @@ -52,6 +52,10 @@ const ToastIcon: React.FC = (props) => { return null; }; + const hasIcon = renderIcon() !== null; + + if (!hasIcon) return null; + return {renderIcon()}; }; diff --git a/src/components/toaster.tsx b/src/components/toaster.tsx index 445defe..a15330a 100644 --- a/src/components/toaster.tsx +++ b/src/components/toaster.tsx @@ -60,7 +60,7 @@ export const Toaster: React.FC = (props) => { alignItems: 'center', }} > - {icon && } +
{title && {title}} {description && (