Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unwinding context during selective hydration #25876

Merged
merged 7 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
TODO_scheduleIdleDOMSchedulerTask(() => {
root.render(<App a="AA" />);
});
expect(Scheduler).toFlushAndYieldThrough(['App', 'AA', 'DefaultContext']);
expect(Scheduler).toFlushAndYieldThrough(['App', 'A']);

dispatchClickEvent(spanA);
expect(Scheduler).toHaveYielded(['A']);
Expand Down
3 changes: 2 additions & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -2245,8 +2245,9 @@ function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
// Selective hydration. An update flowed into a dehydrated tree.
// Interrupt the current render so the work loop can switch to the
// hydration lane.
workInProgress = null;
workInProgressRootExitStatus = RootDidNotComplete;
// `workInProgress` is not set to `null` to allow unwinding in
// `prepareFreshStack`.
tyao1 marked this conversation as resolved.
Show resolved Hide resolved
break outer;
}
default: {
Expand Down