From 9c06bac91b0cc6277fd80542b9adde32f268abf0 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Mon, 19 Feb 2024 11:41:17 +0800 Subject: [PATCH] fix: dead loop --- src/provider.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/provider.tsx b/src/provider.tsx index a9a3404..58f4670 100644 --- a/src/provider.tsx +++ b/src/provider.tsx @@ -31,10 +31,8 @@ export const PushyProvider = ({ const [lastError, setLastError] = useState(); const dismissError = useCallback(() => { - if (lastError) { - setLastError(undefined); - } - }, [lastError]); + setLastError(undefined); + }, []); const showAlert = useCallback( (...args: Parameters) => {