File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
fixtures/ssr/src/components
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,16 @@ export default class Chrome extends Component {
26
26
< Theme . Provider value = { this . state . theme } >
27
27
{ this . props . children }
28
28
< div >
29
- < ThemeToggleButton onChange = { theme => this . setState ( { theme} ) } />
29
+ < ThemeToggleButton
30
+ onChange = { theme => {
31
+ React . unstable_withSuspenseConfig (
32
+ ( ) => {
33
+ this . setState ( { theme} ) ;
34
+ } ,
35
+ { timeoutMs : 6000 }
36
+ ) ;
37
+ } }
38
+ />
30
39
</ div >
31
40
</ Theme . Provider >
32
41
< script
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ import {
173
173
requestCurrentTime ,
174
174
retryDehydratedSuspenseBoundary ,
175
175
scheduleWork ,
176
+ renderDidSuspendDelayIfPossible ,
176
177
} from './ReactFiberWorkLoop' ;
177
178
178
179
const ReactCurrentOwner = ReactSharedInternals . ReactCurrentOwner ;
@@ -2060,6 +2061,8 @@ function updateDehydratedSuspenseComponent(
2060
2061
// since we now have higher priority work, but in case it doesn't, we need to prepare to
2061
2062
// render something, if we time out. Even if that requires us to delete everything and
2062
2063
// skip hydration.
2064
+ // Delay having to do this as long as the suspense timeout allows us.
2065
+ renderDidSuspendDelayIfPossible ( ) ;
2063
2066
return retrySuspenseComponentWithoutHydrating (
2064
2067
current ,
2065
2068
workInProgress ,
You can’t perform that action at this time.
0 commit comments