diff --git a/package.json b/package.json index d99762e..bd44cde 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "http-react", - "version": "3.6.4", + "version": "3.6.6", "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 c752721..5fad1ce 100644 --- a/src/hooks/use-fetch.ts +++ b/src/hooks/use-fetch.ts @@ -980,8 +980,9 @@ export function useFetch( if (isMutating) { if (serialize($data) !== serialize(cacheForMutation.get(resolvedKey))) { - cacheForMutation.set(idString, data) + cacheForMutation.set(idString, $data) if (isMutating) { + forceMutate($data) if (handleMutate) { if (url === '') { ;(onMutate as any)($data, imperativeFetch) diff --git a/src/utils/shared.ts b/src/utils/shared.ts index be7ecee..6e2691a 100644 --- a/src/utils/shared.ts +++ b/src/utils/shared.ts @@ -194,7 +194,6 @@ export function $searchParams(input: string) { const parsedParams = new Map() - // @ts-expect-error for (let key of allKeys) { const allValues = searchParams.getAll(key) diff --git a/tsconfig.json b/tsconfig.json index 18736d8..9737e95 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES5", + "target": "ES2015", "outDir": "./dist", "module": "CommonJS", "lib": ["es6", "dom", "es2019"],