Skip to content

Commit 4f2e8aa

Browse files
Update packages/toolkit/src/query/react/buildHooks.ts
Co-authored-by: Lenz Weber-Tronic <[email protected]>
1 parent 86bb20a commit 4f2e8aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
696696
// isFetching = true any time a request is in flight
697697
const isFetching = currentState.isLoading
698698
// isLoading = true only when loading while no data is present yet (initial load with no data in the cache)
699-
const isLoading = !hasError && !hasData && isFetching
699+
const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching
700700
// isSuccess = true when data is present
701701
const isSuccess = currentState.isSuccess || (isFetching && hasData)
702702

0 commit comments

Comments
 (0)