@@ -4153,7 +4153,10 @@ function renderNode(
4153
4153
// $FlowFixMe[method-unbinding]
4154
4154
if ( typeof x . then === 'function' ) {
4155
4155
const wakeable : Wakeable = ( x : any ) ;
4156
- const thenableState = getThenableStateAfterSuspending ( ) ;
4156
+ const thenableState =
4157
+ thrownValue === SuspenseException
4158
+ ? getThenableStateAfterSuspending ( )
4159
+ : null ;
4157
4160
const newTask = spawnNewSuspendedReplayTask (
4158
4161
request ,
4159
4162
// $FlowFixMe: Refined.
@@ -4186,7 +4189,10 @@ function renderNode(
4186
4189
// performance but it can lead to stack overflows in extremely deep trees.
4187
4190
// We do have the ability to create a trampoile if this happens which makes
4188
4191
// this kind of zero-cost.
4189
- const thenableState = getThenableStateAfterSuspending ( ) ;
4192
+ const thenableState =
4193
+ thrownValue === SuspenseException
4194
+ ? getThenableStateAfterSuspending ( )
4195
+ : null ;
4190
4196
const newTask = spawnNewSuspendedReplayTask (
4191
4197
request ,
4192
4198
// $FlowFixMe: Refined.
@@ -4246,7 +4252,10 @@ function renderNode(
4246
4252
// $FlowFixMe[method-unbinding]
4247
4253
if ( typeof x . then === 'function' ) {
4248
4254
const wakeable : Wakeable = ( x : any ) ;
4249
- const thenableState = getThenableStateAfterSuspending ( ) ;
4255
+ const thenableState =
4256
+ thrownValue === SuspenseException
4257
+ ? getThenableStateAfterSuspending ( )
4258
+ : null ;
4250
4259
const newTask = spawnNewSuspendedRenderTask (
4251
4260
request ,
4252
4261
// $FlowFixMe: Refined.
@@ -4317,7 +4326,10 @@ function renderNode(
4317
4326
// performance but it can lead to stack overflows in extremely deep trees.
4318
4327
// We do have the ability to create a trampoile if this happens which makes
4319
4328
// this kind of zero-cost.
4320
- const thenableState = getThenableStateAfterSuspending ( ) ;
4329
+ const thenableState =
4330
+ thrownValue === SuspenseException
4331
+ ? getThenableStateAfterSuspending ( )
4332
+ : null ;
4321
4333
const newTask = spawnNewSuspendedRenderTask (
4322
4334
request ,
4323
4335
// $FlowFixMe: Refined.
@@ -5233,7 +5245,10 @@ function retryRenderTask(
5233
5245
if ( typeof x . then === 'function' ) {
5234
5246
// Something suspended again, let's pick it back up later.
5235
5247
segment . status = PENDING ;
5236
- task . thenableState = getThenableStateAfterSuspending ( ) ;
5248
+ task . thenableState =
5249
+ thrownValue === SuspenseException
5250
+ ? getThenableStateAfterSuspending ( )
5251
+ : null ;
5237
5252
const ping = task . ping ;
5238
5253
// We've asserted that x is a thenable above
5239
5254
( x : any ) . then ( ping , ping ) ;
@@ -5338,7 +5353,10 @@ function retryReplayTask(request: Request, task: ReplayTask): void {
5338
5353
// Something suspended again, let's pick it back up later.
5339
5354
const ping = task . ping ;
5340
5355
x . then ( ping , ping ) ;
5341
- task . thenableState = getThenableStateAfterSuspending ( ) ;
5356
+ task . thenableState =
5357
+ thrownValue === SuspenseException
5358
+ ? getThenableStateAfterSuspending ( )
5359
+ : null ;
5342
5360
return ;
5343
5361
}
5344
5362
}
0 commit comments