Skip to content

Commit 6c77e92

Browse files
committed
Don't try to hydrate a hidden Offscreen tree (#32862)
I found a bug even before the Activity hydration stuff. If we're hydrating an Offscreen boundary in its "hidden" state it won't have any content to hydrate so will trigger hydration errors (which are then eaten by the Offscreen boundary itself). Leaving it not prewarmed. This doesn't happen in the simple case because we'd be hydrating at a higher priority than Offscreen at the root, and those are deferred to Offscreen by not having higher priority. However, we've hydrating at the Offscreen priority, which we do inside Suspense boundaries, then it tries to hydrate against an empty set. I ended up moving this to the Activity boundary in a future PR since it's the SSR side that decided where to not render something and it only has a concept of Activity, no Offscreen. 1dc05a5#diff-d5166797ebbc5b646a49e6a06a049330ca617985d7a6edf3ad1641b43fde1ddfR1111 DiffTrain build for [b04254f](b04254f)
1 parent a0c6870 commit 6c77e92

23 files changed

+224
-216
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.2.0-native-fb-539bbdbd-20250415
1+
19.2.0-native-fb-b04254fd-20250415

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<16d0d95fb5af14faa6ffd565f8ac64cf>>
10+
* @generated SignedSource<<fd12866fb2da2348897605e7db4ee211>>
1111
*/
1212

1313
"use strict";
@@ -404,5 +404,5 @@ __DEV__ &&
404404
exports.useFormStatus = function () {
405405
return resolveDispatcher().useHostTransitionStatus();
406406
};
407-
exports.version = "19.2.0-native-fb-539bbdbd-20250415";
407+
exports.version = "19.2.0-native-fb-b04254fd-20250415";
408408
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<c7fe6971ae313837e5c6520df1df5ac1>>
10+
* @generated SignedSource<<0cee692fd0e4e197fb462a88b80f6799>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.2.0-native-fb-539bbdbd-20250415";
206+
exports.version = "19.2.0-native-fb-b04254fd-20250415";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<c7fe6971ae313837e5c6520df1df5ac1>>
10+
* @generated SignedSource<<0cee692fd0e4e197fb462a88b80f6799>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.2.0-native-fb-539bbdbd-20250415";
206+
exports.version = "19.2.0-native-fb-b04254fd-20250415";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<93ab681eecb0c3d22e0af38a0619be48>>
10+
* @generated SignedSource<<36b8800ad277bcf7877dc1204fe0275a>>
1111
*/
1212

1313
/*
@@ -9367,31 +9367,31 @@ __DEV__ &&
93679367
if ((workInProgress.mode & ConcurrentMode) === NoMode)
93689368
(workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
93699369
null !== current && pushTransition(workInProgress, null),
9370-
reuseHiddenContextOnStack(workInProgress),
9371-
pushOffscreenSuspenseHandler(workInProgress);
9372-
else if (0 !== (renderLanes & 536870912))
9373-
(workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
9374-
null !== current &&
9375-
pushTransition(
9370+
reuseHiddenContextOnStack(workInProgress);
9371+
else {
9372+
if (0 === (renderLanes & 536870912) || isHydrating)
9373+
return (
9374+
(workInProgress.lanes = workInProgress.childLanes = 536870912),
9375+
deferHiddenOffscreenComponent(
9376+
current,
93769377
workInProgress,
9377-
null !== prevState ? prevState.cachePool : null
9378-
),
9379-
null !== prevState
9380-
? pushHiddenContext(workInProgress, prevState)
9381-
: reuseHiddenContextOnStack(workInProgress),
9382-
pushOffscreenSuspenseHandler(workInProgress);
9383-
else
9384-
return (
9385-
(workInProgress.lanes = workInProgress.childLanes = 536870912),
9386-
deferHiddenOffscreenComponent(
9387-
current,
9378+
null !== prevState
9379+
? prevState.baseLanes | renderLanes
9380+
: renderLanes,
9381+
renderLanes
9382+
)
9383+
);
9384+
workInProgress.memoizedState = { baseLanes: 0, cachePool: null };
9385+
null !== current &&
9386+
pushTransition(
93889387
workInProgress,
9389-
null !== prevState
9390-
? prevState.baseLanes | renderLanes
9391-
: renderLanes,
9392-
renderLanes
9393-
)
9394-
);
9388+
null !== prevState ? prevState.cachePool : null
9389+
);
9390+
null !== prevState
9391+
? pushHiddenContext(workInProgress, prevState)
9392+
: reuseHiddenContextOnStack(workInProgress);
9393+
}
9394+
pushOffscreenSuspenseHandler(workInProgress);
93959395
} else
93969396
null !== prevState
93979397
? (pushTransition(workInProgress, prevState.cachePool),
@@ -25829,11 +25829,11 @@ __DEV__ &&
2582925829
};
2583025830
(function () {
2583125831
var isomorphicReactPackageVersion = React.version;
25832-
if ("19.2.0-native-fb-539bbdbd-20250415" !== isomorphicReactPackageVersion)
25832+
if ("19.2.0-native-fb-b04254fd-20250415" !== isomorphicReactPackageVersion)
2583325833
throw Error(
2583425834
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2583525835
(isomorphicReactPackageVersion +
25836-
"\n - react-dom: 19.2.0-native-fb-539bbdbd-20250415\nLearn more: https://react.dev/warnings/version-mismatch")
25836+
"\n - react-dom: 19.2.0-native-fb-b04254fd-20250415\nLearn more: https://react.dev/warnings/version-mismatch")
2583725837
);
2583825838
})();
2583925839
("function" === typeof Map &&
@@ -25870,10 +25870,10 @@ __DEV__ &&
2587025870
!(function () {
2587125871
var internals = {
2587225872
bundleType: 1,
25873-
version: "19.2.0-native-fb-539bbdbd-20250415",
25873+
version: "19.2.0-native-fb-b04254fd-20250415",
2587425874
rendererPackageName: "react-dom",
2587525875
currentDispatcherRef: ReactSharedInternals,
25876-
reconcilerVersion: "19.2.0-native-fb-539bbdbd-20250415"
25876+
reconcilerVersion: "19.2.0-native-fb-b04254fd-20250415"
2587725877
};
2587825878
internals.overrideHookState = overrideHookState;
2587925879
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -26017,5 +26017,5 @@ __DEV__ &&
2601726017
listenToAllSupportedEvents(container);
2601826018
return new ReactDOMHydrationRoot(initialChildren);
2601926019
};
26020-
exports.version = "19.2.0-native-fb-539bbdbd-20250415";
26020+
exports.version = "19.2.0-native-fb-b04254fd-20250415";
2602126021
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<e479eeb40526dbaaa1857674a7bf84b8>>
10+
* @generated SignedSource<<6bd4e8ce8017671956165315afaa7ceb>>
1111
*/
1212

1313
/*
@@ -6523,29 +6523,31 @@ function updateOffscreenComponent(
65236523
if (0 === (workInProgress.mode & 1))
65246524
(workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
65256525
null !== current && pushTransition(workInProgress, null),
6526-
reuseHiddenContextOnStack(),
6527-
pushOffscreenSuspenseHandler(workInProgress);
6528-
else if (0 !== (renderLanes & 536870912))
6529-
(workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
6530-
null !== current &&
6531-
pushTransition(
6526+
reuseHiddenContextOnStack();
6527+
else {
6528+
if (0 === (renderLanes & 536870912) || isHydrating)
6529+
return (
6530+
(workInProgress.lanes = workInProgress.childLanes = 536870912),
6531+
deferHiddenOffscreenComponent(
6532+
current,
65326533
workInProgress,
6533-
null !== prevState ? prevState.cachePool : null
6534-
),
6535-
null !== prevState
6536-
? pushHiddenContext(workInProgress, prevState)
6537-
: reuseHiddenContextOnStack(),
6538-
pushOffscreenSuspenseHandler(workInProgress);
6539-
else
6540-
return (
6541-
(workInProgress.lanes = workInProgress.childLanes = 536870912),
6542-
deferHiddenOffscreenComponent(
6543-
current,
6534+
null !== prevState
6535+
? prevState.baseLanes | renderLanes
6536+
: renderLanes,
6537+
renderLanes
6538+
)
6539+
);
6540+
workInProgress.memoizedState = { baseLanes: 0, cachePool: null };
6541+
null !== current &&
6542+
pushTransition(
65446543
workInProgress,
6545-
null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,
6546-
renderLanes
6547-
)
6548-
);
6544+
null !== prevState ? prevState.cachePool : null
6545+
);
6546+
null !== prevState
6547+
? pushHiddenContext(workInProgress, prevState)
6548+
: reuseHiddenContextOnStack();
6549+
}
6550+
pushOffscreenSuspenseHandler(workInProgress);
65496551
} else
65506552
null !== prevState
65516553
? (pushTransition(workInProgress, prevState.cachePool),
@@ -16030,14 +16032,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1603016032
};
1603116033
var isomorphicReactPackageVersion$jscomp$inline_1805 = React.version;
1603216034
if (
16033-
"19.2.0-native-fb-539bbdbd-20250415" !==
16035+
"19.2.0-native-fb-b04254fd-20250415" !==
1603416036
isomorphicReactPackageVersion$jscomp$inline_1805
1603516037
)
1603616038
throw Error(
1603716039
formatProdErrorMessage(
1603816040
527,
1603916041
isomorphicReactPackageVersion$jscomp$inline_1805,
16040-
"19.2.0-native-fb-539bbdbd-20250415"
16042+
"19.2.0-native-fb-b04254fd-20250415"
1604116043
)
1604216044
);
1604316045
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16059,10 +16061,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1605916061
};
1606016062
var internals$jscomp$inline_2261 = {
1606116063
bundleType: 0,
16062-
version: "19.2.0-native-fb-539bbdbd-20250415",
16064+
version: "19.2.0-native-fb-b04254fd-20250415",
1606316065
rendererPackageName: "react-dom",
1606416066
currentDispatcherRef: ReactSharedInternals,
16065-
reconcilerVersion: "19.2.0-native-fb-539bbdbd-20250415"
16067+
reconcilerVersion: "19.2.0-native-fb-b04254fd-20250415"
1606616068
};
1606716069
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1606816070
var hook$jscomp$inline_2262 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16166,4 +16168,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1616616168
listenToAllSupportedEvents(container);
1616716169
return new ReactDOMHydrationRoot(initialChildren);
1616816170
};
16169-
exports.version = "19.2.0-native-fb-539bbdbd-20250415";
16171+
exports.version = "19.2.0-native-fb-b04254fd-20250415";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<8cfac5997bdeedaaaf2d6fd569cc144a>>
10+
* @generated SignedSource<<b444ccc017848b4a09aa98b7f899f1ad>>
1111
*/
1212

1313
/*
@@ -6693,29 +6693,31 @@ function updateOffscreenComponent(
66936693
if (0 === (workInProgress.mode & 1))
66946694
(workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
66956695
null !== current && pushTransition(workInProgress, null),
6696-
reuseHiddenContextOnStack(),
6697-
pushOffscreenSuspenseHandler(workInProgress);
6698-
else if (0 !== (renderLanes & 536870912))
6699-
(workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
6700-
null !== current &&
6701-
pushTransition(
6696+
reuseHiddenContextOnStack();
6697+
else {
6698+
if (0 === (renderLanes & 536870912) || isHydrating)
6699+
return (
6700+
(workInProgress.lanes = workInProgress.childLanes = 536870912),
6701+
deferHiddenOffscreenComponent(
6702+
current,
67026703
workInProgress,
6703-
null !== prevState ? prevState.cachePool : null
6704-
),
6705-
null !== prevState
6706-
? pushHiddenContext(workInProgress, prevState)
6707-
: reuseHiddenContextOnStack(),
6708-
pushOffscreenSuspenseHandler(workInProgress);
6709-
else
6710-
return (
6711-
(workInProgress.lanes = workInProgress.childLanes = 536870912),
6712-
deferHiddenOffscreenComponent(
6713-
current,
6704+
null !== prevState
6705+
? prevState.baseLanes | renderLanes
6706+
: renderLanes,
6707+
renderLanes
6708+
)
6709+
);
6710+
workInProgress.memoizedState = { baseLanes: 0, cachePool: null };
6711+
null !== current &&
6712+
pushTransition(
67146713
workInProgress,
6715-
null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,
6716-
renderLanes
6717-
)
6718-
);
6714+
null !== prevState ? prevState.cachePool : null
6715+
);
6716+
null !== prevState
6717+
? pushHiddenContext(workInProgress, prevState)
6718+
: reuseHiddenContextOnStack();
6719+
}
6720+
pushOffscreenSuspenseHandler(workInProgress);
67196721
} else
67206722
null !== prevState
67216723
? (pushTransition(workInProgress, prevState.cachePool),
@@ -16715,14 +16717,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1671516717
};
1671616718
var isomorphicReactPackageVersion$jscomp$inline_1902 = React.version;
1671716719
if (
16718-
"19.2.0-native-fb-539bbdbd-20250415" !==
16720+
"19.2.0-native-fb-b04254fd-20250415" !==
1671916721
isomorphicReactPackageVersion$jscomp$inline_1902
1672016722
)
1672116723
throw Error(
1672216724
formatProdErrorMessage(
1672316725
527,
1672416726
isomorphicReactPackageVersion$jscomp$inline_1902,
16725-
"19.2.0-native-fb-539bbdbd-20250415"
16727+
"19.2.0-native-fb-b04254fd-20250415"
1672616728
)
1672716729
);
1672816730
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16744,10 +16746,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1674416746
};
1674516747
var internals$jscomp$inline_1909 = {
1674616748
bundleType: 0,
16747-
version: "19.2.0-native-fb-539bbdbd-20250415",
16749+
version: "19.2.0-native-fb-b04254fd-20250415",
1674816750
rendererPackageName: "react-dom",
1674916751
currentDispatcherRef: ReactSharedInternals,
16750-
reconcilerVersion: "19.2.0-native-fb-539bbdbd-20250415",
16752+
reconcilerVersion: "19.2.0-native-fb-b04254fd-20250415",
1675116753
getLaneLabelMap: function () {
1675216754
for (
1675316755
var map = new Map(), lane = 1, index$297 = 0;
@@ -16866,4 +16868,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1686616868
listenToAllSupportedEvents(container);
1686716869
return new ReactDOMHydrationRoot(initialChildren);
1686816870
};
16869-
exports.version = "19.2.0-native-fb-539bbdbd-20250415";
16871+
exports.version = "19.2.0-native-fb-b04254fd-20250415";

0 commit comments

Comments
 (0)