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 = (
2424 if ( defaultedOptions . suspense ) {
2525 // Handle staleTime to ensure minimum 1000ms in Suspense mode
2626 // This prevents unnecessary refetching when components remount after suspending
27+ const MIN_SUSPENSE_TIME_MS = 1000
2728
2829 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 )
3031
3132 const originalStaleTime = defaultedOptions . staleTime
3233 defaultedOptions . staleTime =
@@ -35,7 +36,7 @@ export const ensureSuspenseTimers = (
3536 : clamp ( originalStaleTime )
3637
3738 if ( typeof defaultedOptions . gcTime === 'number' ) {
38- defaultedOptions . gcTime = Math . max ( defaultedOptions . gcTime , 1000 )
39+ defaultedOptions . gcTime = Math . max ( defaultedOptions . gcTime , MIN_SUSPENSE_TIME_MS )
3940 }
4041 }
4142}
You can’t perform that action at this time.
0 commit comments