Skip to content

Commit 6689827

Browse files
committed
feat: attempt to always re-suspend
1 parent 2a00fb6 commit 6689827

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/react-query/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* istanbul ignore file */
2+
import { startTransition } from 'react'
3+
import { notifyManager } from '@tanstack/query-core'
24

35
// Re-export core
46
export * from '@tanstack/query-core'
@@ -54,3 +56,5 @@ export { useMutation } from './useMutation'
5456
export { mutationOptions } from './mutationOptions'
5557
export { useInfiniteQuery } from './useInfiniteQuery'
5658
export { useIsRestoring, IsRestoringProvider } from './IsRestoringProvider'
59+
60+
notifyManager.setNotifyFunction(startTransition)

packages/react-query/src/suspense.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const shouldSuspend = (
5656
| DefaultedQueryObserverOptions<any, any, any, any, any>
5757
| undefined,
5858
result: QueryObserverResult<any, any>,
59-
) => defaultedOptions?.suspense && result.isPending
59+
) => defaultedOptions?.suspense && result.isFetching
6060

6161
export const fetchOptimistic = <
6262
TQueryFnData,

0 commit comments

Comments
 (0)