You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-query/src/useBaseQuery.ts
+5-17Lines changed: 5 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,6 @@ export function useBaseQuery<
129
129
>(defaultedOptions.queryHash),
130
130
})
131
131
){
132
-
console.log('throwing error')
133
132
throwresult.error
134
133
}
135
134
@@ -138,30 +137,19 @@ export function useBaseQuery<
138
137
result,
139
138
)
140
139
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
-
)
152
140
if(
153
141
defaultedOptions.experimental_prefetchInRender&&
154
142
!isServer&&
155
143
willFetch(result,isRestoring)
156
144
){
157
145
// This fetching in the render should likely be done as part of the getOptimisticResult() considering https://github.com/TanStack/query/issues/8507
158
-
constcacheEntryState=cacheEntry?.state
146
+
conststate=cacheEntry?.state
159
147
160
148
constshouldFetch=
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')
165
153
166
154
constpromise=shouldFetch
167
155
? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
0 commit comments