File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,10 @@ export const ensureSuspenseTimers = (
24
24
if ( defaultedOptions . suspense ) {
25
25
// Handle staleTime to ensure minimum 1000ms in Suspense mode
26
26
// This prevents unnecessary refetching when components remount after suspending
27
+ const MIN_SUSPENSE_TIME_MS = 1000
27
28
28
29
const clamp = ( value : number | 'static' | undefined ) =>
29
- value === 'static' ? value : Math . max ( value ?? 1000 , 1000 )
30
+ value === 'static' ? value : Math . max ( value ?? MIN_SUSPENSE_TIME_MS , MIN_SUSPENSE_TIME_MS )
30
31
31
32
const originalStaleTime = defaultedOptions . staleTime
32
33
defaultedOptions . staleTime =
@@ -35,7 +36,7 @@ export const ensureSuspenseTimers = (
35
36
: clamp ( originalStaleTime )
36
37
37
38
if ( typeof defaultedOptions . gcTime === 'number' ) {
38
- defaultedOptions . gcTime = Math . max ( defaultedOptions . gcTime , 1000 )
39
+ defaultedOptions . gcTime = Math . max ( defaultedOptions . gcTime , MIN_SUSPENSE_TIME_MS )
39
40
}
40
41
}
41
42
}
You can’t perform that action at this time.
0 commit comments