@tanstack/react-query 4.29.2 → 4.29.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/useQueries.ts CHANGED
@@ -157,6 +157,7 @@ export function useQueries<T extends any[]>({
157
157
  }): QueriesResults<T> {
158
158
  const queryClient = useQueryClient({ context })
159
159
  const isRestoring = useIsRestoring()
160
+ const errorResetBoundary = useQueryErrorResetBoundary()
160
161
 
161
162
  const defaultedQueries = React.useMemo(
162
163
  () =>
@@ -173,6 +174,13 @@ export function useQueries<T extends any[]>({
173
174
  [queries, queryClient, isRestoring],
174
175
  )
175
176
 
177
+ defaultedQueries.forEach((query) => {
178
+ ensureStaleTime(query)
179
+ ensurePreventErrorBoundaryRetry(query, errorResetBoundary)
180
+ })
181
+
182
+ useClearResetErrorBoundary(errorResetBoundary)
183
+
176
184
  const [observer] = React.useState(
177
185
  () => new QueriesObserver(queryClient, defaultedQueries),
178
186
  )
@@ -197,15 +205,6 @@ export function useQueries<T extends any[]>({
197
205
  observer.setQueries(defaultedQueries, { listeners: false })
198
206
  }, [defaultedQueries, observer])
199
207
 
200
- const errorResetBoundary = useQueryErrorResetBoundary()
201
-
202
- defaultedQueries.forEach((query) => {
203
- ensurePreventErrorBoundaryRetry(query, errorResetBoundary)
204
- ensureStaleTime(query)
205
- })
206
-
207
- useClearResetErrorBoundary(errorResetBoundary)
208
-
209
208
  const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>
210
209
  shouldSuspend(defaultedQueries[index], result, isRestoring),
211
210
  )