We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86bb20a commit 4f2e8aaCopy full SHA for 4f2e8aa
packages/toolkit/src/query/react/buildHooks.ts
@@ -696,7 +696,7 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
696
// isFetching = true any time a request is in flight
697
const isFetching = currentState.isLoading
698
// 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
+ const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching
700
// isSuccess = true when data is present
701
const isSuccess = currentState.isSuccess || (isFetching && hasData)
702
0 commit comments