From 7e0fa311faa7228e701855d9ed9e3263542f77fa Mon Sep 17 00:00:00 2001 From: danybeltran Date: Sun, 12 May 2024 12:09:28 -0600 Subject: [PATCH] fix(resetError): Fixes the resetError function --- package.json | 2 +- src/hooks/use-fetch.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 010bd72..8e14947 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "http-react", - "version": "3.3.8", + "version": "3.3.9", "description": "React hooks for data fetching", "main": "dist/index.js", "scripts": { diff --git a/src/hooks/use-fetch.ts b/src/hooks/use-fetch.ts index 3eefda9..c6d0de2 100644 --- a/src/hooks/use-fetch.ts +++ b/src/hooks/use-fetch.ts @@ -1468,9 +1468,11 @@ export function useFetch( ) function resetError() { - setError(null) - requestsProvider.emit(requestCallId, { - error: null + hasErrors.set(resolvedKey, false) + hasErrors.set(resolvedDataKey, false) + + requestsProvider.emit(resolvedKey, { + error: false }) }