From 8b2f166c41c453026fde4dc9eded1c9ee927cc46 Mon Sep 17 00:00:00 2001 From: Victor Lopez Date: Sun, 14 Feb 2021 17:27:28 -0600 Subject: [PATCH] feat: reset hook state when config changes with outstanding manual fetch --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4ac76b68..113cdd7e 100644 --- a/src/index.js +++ b/src/index.js @@ -267,7 +267,7 @@ export function makeUseAxios(configureOptions) { ).catch(() => {}) } - return cancelOutstandingRequest + return () => { cancelOutstandingRequest(options.manual)} }, [config, options, withCancelToken, cancelOutstandingRequest]) const refetch = React.useCallback(