diff --git a/src/useFetch.ts b/src/useFetch.ts index f51f921..cf35a81 100644 --- a/src/useFetch.ts +++ b/src/useFetch.ts @@ -158,7 +158,7 @@ function useFetch<TData = any>(...args: UseFetchArgs): UseFetch<TData> { } finally { timedout.current = false if (timer) clearTimeout(timer) - controller.current = undefined + if (controller.current === theController) controller.current = undefined } if (newRes && !newRes.ok && !error.current) error.current = makeError(newRes.status, newRes.statusText)