Skip to content

Commit f93bec9

Browse files
committed
Fix cleanup hook issues
1 parent 249e0ec commit f93bec9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/toolkit/src/query/react/buildHooks.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ import { useStableQueryArgs } from './useSerializedStableValue'
6565
import { useShallowStableValue } from './useShallowStableValue'
6666
import type { InfiniteQueryDirection } from '../core/apiState'
6767
import { isInfiniteQueryDefinition } from '../endpointDefinitions'
68-
import {
69-
StartInfiniteQueryActionCreatorOptions,
70-
StartInfiniteQueryActionCreator,
71-
} from '../core/buildInitiate'
68+
import { StartInfiniteQueryActionCreator } from '../core/buildInitiate'
7269

7370
// Copy-pasted from React-Redux
7471
const canUseDOM = () =>
@@ -1647,7 +1644,8 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
16471644
useEffect(() => {
16481645
return () => {
16491646
promiseRef.current?.unsubscribe?.()
1650-
promiseRef.current = undefined
1647+
// eslint-disable-next-line react-hooks/exhaustive-deps
1648+
;(promiseRef.current as any) = undefined
16511649
}
16521650
}, [promiseRef])
16531651
}

0 commit comments

Comments
 (0)