Skip to content

Commit

Permalink
Schedule client renders using non-hydration lane
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Dec 14, 2024
1 parent 4dff0e6 commit b24e916
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ import {
disableLegacyMode,
disableDefaultPropsExceptForClasses,
enableOwnerStacks,
enableHydrationLaneScheduling,
} from 'shared/ReactFeatureFlags';
import isArray from 'shared/isArray';
import shallowEqual from 'shared/shallowEqual';
Expand Down Expand Up @@ -147,6 +148,7 @@ import {
NoLane,
NoLanes,
OffscreenLane,
DefaultLane,
DefaultHydrationLane,
SomeRetryLane,
includesSomeLane,
Expand Down Expand Up @@ -2649,14 +2651,10 @@ function mountDehydratedSuspenseComponent(
// have timed out. In theory we could render it in this pass but it would have the
// wrong priority associated with it and will prevent hydration of parent path.
// Instead, we'll leave work left on it to render it in a separate commit.

// TODO This time should be the time at which the server rendered response that is
// a parent to this boundary was displayed. However, since we currently don't have
// a protocol to transfer that time, we'll just estimate it by using the current
// time. This will mean that Suspense timeouts are slightly shifted to later than
// they should be.
// Schedule a normal pri update to render this content.
workInProgress.lanes = laneToLanes(DefaultHydrationLane);
workInProgress.lanes = laneToLanes(
enableHydrationLaneScheduling ? DefaultLane : DefaultHydrationLane,
);
} else {
// We'll continue hydrating the rest at offscreen priority since we'll already
// be showing the right content coming from the server, it is no rush.
Expand Down

0 comments on commit b24e916

Please sign in to comment.