diff --git a/packages/toast/src/ToastTimer.tsx b/packages/toast/src/ToastTimer.tsx index 483448cc8..9d4698668 100644 --- a/packages/toast/src/ToastTimer.tsx +++ b/packages/toast/src/ToastTimer.tsx @@ -27,8 +27,12 @@ export const ToastTimer: FunctionComponent = ({ toast, index }) => { const remainingTimeRef = useRef(duration) const dismissToastOnEnd = useCallback(() => { + if (!shouldAutoClose) { + return + } + dismissToast(toast.id) - }, [toast.id]) + }, [shouldAutoClose, toast.id]) const clearTimer = useCallback(() => { if (toastTimerIdRef.current) {