Skip to content

Commit a269d27

Browse files
committed
cool
1 parent f1daa83 commit a269d27

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

packages/react-query/src/useBaseQuery.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ export function useBaseQuery<
129129
>(defaultedOptions.queryHash),
130130
})
131131
) {
132-
console.log('throwing error')
133132
throw result.error
134133
}
135134

@@ -138,30 +137,19 @@ export function useBaseQuery<
138137
result,
139138
)
140139

141-
console.log(
142-
'prefetchInRender',
143-
defaultedOptions.experimental_prefetchInRender,
144-
{
145-
willFetch: willFetch(result, isRestoring),
146-
isRestoring: isRestoring,
147-
isLoading: result.isLoading,
148-
isFetching: result.isFetching,
149-
isServer: isServer,
150-
},
151-
)
152140
if (
153141
defaultedOptions.experimental_prefetchInRender &&
154142
!isServer &&
155143
willFetch(result, isRestoring)
156144
) {
157145
// This fetching in the render should likely be done as part of the getOptimisticResult() considering https://github.com/TanStack/query/issues/8507
158-
const cacheEntryState = cacheEntry?.state
146+
const state = cacheEntry?.state
159147

160148
const shouldFetch =
161-
!cacheEntryState ||
162-
(cacheEntryState.data === undefined &&
163-
cacheEntryState.status === 'pending' &&
164-
cacheEntryState.fetchStatus === 'idle')
149+
!state ||
150+
(state.data === undefined &&
151+
state.status === 'pending' &&
152+
state.fetchStatus === 'idle')
165153

166154
const promise = shouldFetch
167155
? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted

0 commit comments

Comments
 (0)