Skip to content

Commit 7e6e61a

Browse files
committed
Fix unwinding context during selective hydration
1 parent b37a68a commit 7e6e61a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
18261826
TODO_scheduleIdleDOMSchedulerTask(() => {
18271827
root.render(<App a="AA" />);
18281828
});
1829-
expect(Scheduler).toFlushAndYieldThrough(['App', 'AA', 'DefaultContext']);
1829+
expect(Scheduler).toFlushAndYieldThrough(['App', 'A']);
18301830

18311831
dispatchClickEvent(spanA);
18321832
expect(Scheduler).toHaveYielded(['A']);

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2245,8 +2245,9 @@ function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
22452245
// Selective hydration. An update flowed into a dehydrated tree.
22462246
// Interrupt the current render so the work loop can switch to the
22472247
// hydration lane.
2248-
workInProgress = null;
22492248
workInProgressRootExitStatus = RootDidNotComplete;
2249+
// `workInProgress` is not set to `null` to allow unwinding in
2250+
// `prepareFreshStack`.
22502251
break outer;
22512252
}
22522253
default: {

0 commit comments

Comments
 (0)