@@ -175,7 +175,6 @@ import {
175
175
} from './ReactEventPriorities' ;
176
176
import { requestCurrentTransition , NoTransition } from './ReactFiberTransition' ;
177
177
import {
178
- SelectiveHydrationException ,
179
178
beginWork as originalBeginWork ,
180
179
replayFunctionComponent ,
181
180
} from './ReactFiberBeginWork' ;
@@ -317,14 +316,13 @@ let workInProgress: Fiber | null = null;
317
316
// The lanes we're rendering
318
317
let workInProgressRootRenderLanes : Lanes = NoLanes ;
319
318
320
- opaque type SuspendedReason = 0 | 1 | 2 | 3 | 4 | 5 | 6 ;
319
+ opaque type SuspendedReason = 0 | 1 | 2 | 3 | 4 | 5 ;
321
320
const NotSuspended : SuspendedReason = 0 ;
322
321
const SuspendedOnError : SuspendedReason = 1 ;
323
322
const SuspendedOnData : SuspendedReason = 2 ;
324
323
const SuspendedOnImmediate : SuspendedReason = 3 ;
325
324
const SuspendedOnDeprecatedThrowPromise : SuspendedReason = 4 ;
326
325
const SuspendedAndReadyToUnwind : SuspendedReason = 5 ;
327
- const SuspendedOnHydration : SuspendedReason = 6 ;
328
326
329
327
// When this is true, the work-in-progress fiber just suspended (or errored) and
330
328
// we've yet to unwind the stack. In some cases, we may yield to the main thread
@@ -1799,17 +1797,6 @@ function handleThrow(root, thrownValue): void {
1799
1797
workInProgressSuspendedReason = shouldAttemptToSuspendUntilDataResolves ( )
1800
1798
? SuspendedOnData
1801
1799
: SuspendedOnImmediate ;
1802
- } else if ( thrownValue === SelectiveHydrationException ) {
1803
- // An update flowed into a dehydrated boundary. Before we can apply the
1804
- // update, we need to finish hydrating. Interrupt the work-in-progress
1805
- // render so we can restart at the hydration lane.
1806
- //
1807
- // The ideal implementation would be able to switch contexts without
1808
- // unwinding the current stack.
1809
- //
1810
- // We could name this something more general but as of now it's the only
1811
- // case where we think this should happen.
1812
- workInProgressSuspendedReason = SuspendedOnHydration ;
1813
1800
} else {
1814
1801
// This is a regular error.
1815
1802
const isWakeable =
@@ -2051,7 +2038,7 @@ function renderRootSync(root: FiberRoot, lanes: Lanes) {
2051
2038
markRenderStarted ( lanes ) ;
2052
2039
}
2053
2040
2054
- outer: do {
2041
+ do {
2055
2042
try {
2056
2043
if (
2057
2044
workInProgressSuspendedReason !== NotSuspended &&
@@ -2067,23 +2054,11 @@ function renderRootSync(root: FiberRoot, lanes: Lanes) {
2067
2054
// function and fork the behavior some other way.
2068
2055
const unitOfWork = workInProgress ;
2069
2056
const thrownValue = workInProgressThrownValue ;
2070
- switch ( workInProgressSuspendedReason ) {
2071
- case SuspendedOnHydration : {
2072
- // Selective hydration. An update flowed into a dehydrated tree.
2073
- // Interrupt the current render so the work loop can switch to the
2074
- // hydration lane.
2075
- workInProgress = null ;
2076
- workInProgressRootExitStatus = RootDidNotComplete ;
2077
- break outer;
2078
- }
2079
- default : {
2080
- // Continue with the normal work loop.
2081
- workInProgressSuspendedReason = NotSuspended ;
2082
- workInProgressThrownValue = null ;
2083
- unwindSuspendedUnitOfWork ( unitOfWork , thrownValue ) ;
2084
- break ;
2085
- }
2086
- }
2057
+ workInProgressSuspendedReason = NotSuspended ;
2058
+ workInProgressThrownValue = null ;
2059
+ unwindSuspendedUnitOfWork ( unitOfWork , thrownValue ) ;
2060
+
2061
+ // Continue with the normal work loop.
2087
2062
}
2088
2063
workLoopSync ( ) ;
2089
2064
break ;
@@ -2241,14 +2216,6 @@ function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
2241
2216
unwindSuspendedUnitOfWork ( unitOfWork , thrownValue ) ;
2242
2217
break ;
2243
2218
}
2244
- case SuspendedOnHydration : {
2245
- // Selective hydration. An update flowed into a dehydrated tree.
2246
- // Interrupt the current render so the work loop can switch to the
2247
- // hydration lane.
2248
- workInProgress = null ;
2249
- workInProgressRootExitStatus = RootDidNotComplete ;
2250
- break outer ;
2251
- }
2252
2219
default : {
2253
2220
throw new Error (
2254
2221
'Unexpected SuspendedReason. This is a bug in React.' ,
@@ -3774,7 +3741,6 @@ if (__DEV__ && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
3774
3741
if (
3775
3742
didSuspendOrErrorWhileHydratingDEV ( ) ||
3776
3743
originalError === SuspenseException ||
3777
- originalError === SelectiveHydrationException ||
3778
3744
( originalError !== null &&
3779
3745
typeof originalError === 'object' &&
3780
3746
typeof originalError . then === 'function' )
0 commit comments