From 1e27263abb124cdde40fc7a6e1ee5d7579107abc Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Mon, 22 Nov 2021 21:08:43 +0100 Subject: [PATCH] Remove useMemo from interval Signed-off-by: Tilman Vatteroth --- src/components/notifications/ui-notification-toast.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/notifications/ui-notification-toast.tsx b/src/components/notifications/ui-notification-toast.tsx index 230b81757..881680386 100644 --- a/src/components/notifications/ui-notification-toast.tsx +++ b/src/components/notifications/ui-notification-toast.tsx @@ -49,7 +49,7 @@ export const UiNotificationToast: React.FC = ({ useInterval( () => setRemainingSteps((lastRemainingSteps) => lastRemainingSteps - 1), - useMemo(() => (dismissed || remainingSteps <= 0 ? null : 1000 / STEPS_PER_SECOND), [dismissed, remainingSteps]) + !dismissed && remainingSteps > 0 ? 1000 / STEPS_PER_SECOND : null ) useEffect(() => {