Skip to content

Commit ec5a98b

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Sync React 19.1.1 into React Native (#52887)
Summary: Pull Request resolved: #52887 Syncs Reac 19.1.1 into React Native. This commit should contains the fix for: - React owner stack in React Native - An issue with React holding shadow node for longer than it needed - An issue that made `startTransition` not working with React Native. ## Changelog: [General][Changed] - Bumped React to 19.1.1 bypass-github-export-checks Reviewed By: cortinico Differential Revision: D79096406 fbshipit-source-id: cbb2f846b1f08ba5ff482cfed5aaddc16df075cc
1 parent 3bff471 commit ec5a98b

17 files changed

+227
-152
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
"nullthrows": "^1.1.1",
104104
"prettier": "3.6.2",
105105
"prettier-plugin-hermes-parser": "0.30.0",
106-
"react": "19.1.0",
107-
"react-test-renderer": "19.1.0",
106+
"react": "19.1.1",
107+
"react-test-renderer": "19.1.1",
108108
"rimraf": "^3.0.2",
109109
"shelljs": "^0.8.5",
110110
"signedsource": "^1.0.0",
@@ -116,7 +116,7 @@
116116
},
117117
"resolutions": {
118118
"eslint-plugin-react-hooks": "6.1.0-canary-12bc60f5-20250613",
119-
"react-is": "19.1.0",
119+
"react-is": "19.1.1",
120120
"on-headers": "1.1.0",
121121
"compression": "1.8.1"
122122
}

packages/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<6b3694149dd8856f0c741d3d94e05646>>
10+
* @generated SignedSource<<3867afec97d5ffc05c5cc474c2cd3f42>>
1111
*
1212
* This file was sync'd from the facebook/react repository.
1313
*/
@@ -410,7 +410,7 @@ __DEV__ &&
410410
prevPrepareStackTrace = error.indexOf("\n");
411411
-1 !== prevPrepareStackTrace &&
412412
(error = error.slice(prevPrepareStackTrace + 1));
413-
prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame");
413+
prevPrepareStackTrace = error.indexOf("react_stack_bottom_frame");
414414
-1 !== prevPrepareStackTrace &&
415415
(prevPrepareStackTrace = error.lastIndexOf(
416416
"\n",
@@ -8990,12 +8990,10 @@ __DEV__ &&
89908990
function updateHostContainer(current, workInProgress) {
89918991
if (doesRequireClone(current, workInProgress)) {
89928992
current = workInProgress.stateNode;
8993-
var container = current.containerInfo,
8994-
newChildSet = createChildNodeSet();
8993+
var newChildSet = createChildNodeSet();
89958994
appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1);
89968995
current.pendingChildren = newChildSet;
89978996
workInProgress.flags |= 4;
8998-
completeRoot(container.containerTag, newChildSet);
89998997
}
90008998
}
90018999
function scheduleRetryEffect(workInProgress, retryQueue) {
@@ -13805,7 +13803,9 @@ __DEV__ &&
1380513803
canonical: instance.canonical
1380613804
};
1380713805
}
13808-
function replaceContainerChildren() {}
13806+
function replaceContainerChildren(container, newChildren) {
13807+
completeRoot(container.containerTag, newChildren);
13808+
}
1380913809
function nativeOnUncaughtError(error, errorInfo) {
1381013810
!1 !==
1381113811
ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog({
@@ -15880,7 +15880,7 @@ __DEV__ &&
1588015880
}
1588115881
};
1588215882
var callComponent = {
15883-
"react-stack-bottom-frame": function (Component, props, secondArg) {
15883+
react_stack_bottom_frame: function (Component, props, secondArg) {
1588415884
var wasRendering = isRendering;
1588515885
isRendering = !0;
1588615886
try {
@@ -15891,9 +15891,9 @@ __DEV__ &&
1589115891
}
1589215892
},
1589315893
callComponentInDEV =
15894-
callComponent["react-stack-bottom-frame"].bind(callComponent),
15894+
callComponent.react_stack_bottom_frame.bind(callComponent),
1589515895
callRender = {
15896-
"react-stack-bottom-frame": function (instance) {
15896+
react_stack_bottom_frame: function (instance) {
1589715897
var wasRendering = isRendering;
1589815898
isRendering = !0;
1589915899
try {
@@ -15903,21 +15903,22 @@ __DEV__ &&
1590315903
}
1590415904
}
1590515905
},
15906-
callRenderInDEV = callRender["react-stack-bottom-frame"].bind(callRender),
15906+
callRenderInDEV = callRender.react_stack_bottom_frame.bind(callRender),
1590715907
callComponentDidMount = {
15908-
"react-stack-bottom-frame": function (finishedWork, instance) {
15908+
react_stack_bottom_frame: function (finishedWork, instance) {
1590915909
try {
1591015910
instance.componentDidMount();
1591115911
} catch (error) {
1591215912
captureCommitPhaseError(finishedWork, finishedWork.return, error);
1591315913
}
1591415914
}
1591515915
},
15916-
callComponentDidMountInDEV = callComponentDidMount[
15917-
"react-stack-bottom-frame"
15918-
].bind(callComponentDidMount),
15916+
callComponentDidMountInDEV =
15917+
callComponentDidMount.react_stack_bottom_frame.bind(
15918+
callComponentDidMount
15919+
),
1591915920
callComponentDidUpdate = {
15920-
"react-stack-bottom-frame": function (
15921+
react_stack_bottom_frame: function (
1592115922
finishedWork,
1592215923
instance,
1592315924
prevProps,
@@ -15931,22 +15932,24 @@ __DEV__ &&
1593115932
}
1593215933
}
1593315934
},
15934-
callComponentDidUpdateInDEV = callComponentDidUpdate[
15935-
"react-stack-bottom-frame"
15936-
].bind(callComponentDidUpdate),
15935+
callComponentDidUpdateInDEV =
15936+
callComponentDidUpdate.react_stack_bottom_frame.bind(
15937+
callComponentDidUpdate
15938+
),
1593715939
callComponentDidCatch = {
15938-
"react-stack-bottom-frame": function (instance, errorInfo) {
15940+
react_stack_bottom_frame: function (instance, errorInfo) {
1593915941
var stack = errorInfo.stack;
1594015942
instance.componentDidCatch(errorInfo.value, {
1594115943
componentStack: null !== stack ? stack : ""
1594215944
});
1594315945
}
1594415946
},
15945-
callComponentDidCatchInDEV = callComponentDidCatch[
15946-
"react-stack-bottom-frame"
15947-
].bind(callComponentDidCatch),
15947+
callComponentDidCatchInDEV =
15948+
callComponentDidCatch.react_stack_bottom_frame.bind(
15949+
callComponentDidCatch
15950+
),
1594815951
callComponentWillUnmount = {
15949-
"react-stack-bottom-frame": function (
15952+
react_stack_bottom_frame: function (
1595015953
current,
1595115954
nearestMountedAncestor,
1595215955
instance
@@ -15958,11 +15961,12 @@ __DEV__ &&
1595815961
}
1595915962
}
1596015963
},
15961-
callComponentWillUnmountInDEV = callComponentWillUnmount[
15962-
"react-stack-bottom-frame"
15963-
].bind(callComponentWillUnmount),
15964+
callComponentWillUnmountInDEV =
15965+
callComponentWillUnmount.react_stack_bottom_frame.bind(
15966+
callComponentWillUnmount
15967+
),
1596415968
callCreate = {
15965-
"react-stack-bottom-frame": function (effect) {
15969+
react_stack_bottom_frame: function (effect) {
1596615970
null != effect.resourceKind &&
1596715971
console.error(
1596815972
"Expected only SimpleEffects when enableUseEffectCRUDOverload is disabled, got %s",
@@ -15974,9 +15978,9 @@ __DEV__ &&
1597415978
return (effect.destroy = create);
1597515979
}
1597615980
},
15977-
callCreateInDEV = callCreate["react-stack-bottom-frame"].bind(callCreate),
15981+
callCreateInDEV = callCreate.react_stack_bottom_frame.bind(callCreate),
1597815982
callDestroy = {
15979-
"react-stack-bottom-frame": function (
15983+
react_stack_bottom_frame: function (
1598015984
current,
1598115985
nearestMountedAncestor,
1598215986
destroy
@@ -15988,16 +15992,15 @@ __DEV__ &&
1598815992
}
1598915993
}
1599015994
},
15991-
callDestroyInDEV =
15992-
callDestroy["react-stack-bottom-frame"].bind(callDestroy),
15995+
callDestroyInDEV = callDestroy.react_stack_bottom_frame.bind(callDestroy),
1599315996
callLazyInit = {
15994-
"react-stack-bottom-frame": function (lazy) {
15997+
react_stack_bottom_frame: function (lazy) {
1599515998
var init = lazy._init;
1599615999
return init(lazy._payload);
1599716000
}
1599816001
},
1599916002
callLazyInitInDEV =
16000-
callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
16003+
callLazyInit.react_stack_bottom_frame.bind(callLazyInit),
1600116004
thenableState = null,
1600216005
thenableIndexCounter = 0,
1600316006
currentDebugInfo = null,
@@ -16616,10 +16619,10 @@ __DEV__ &&
1661616619
(function () {
1661716620
var internals = {
1661816621
bundleType: 1,
16619-
version: "19.1.0",
16622+
version: "19.1.1",
1662016623
rendererPackageName: "react-native-renderer",
1662116624
currentDispatcherRef: ReactSharedInternals,
16622-
reconcilerVersion: "19.1.0"
16625+
reconcilerVersion: "19.1.1"
1662316626
};
1662416627
null !== extraDevToolsConfig &&
1662516628
(internals.rendererConfig = extraDevToolsConfig);

packages/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<7430b56dac3186eca669ae53bbf1f23d>>
10+
* @generated SignedSource<<dd09ec6a46065f136c43441038691b5e>>
1111
*
1212
* This file was sync'd from the facebook/react repository.
1313
*/
@@ -7013,12 +7013,10 @@ function appendAllChildrenToContainer(
70137013
function updateHostContainer(current, workInProgress) {
70147014
if (doesRequireClone(current, workInProgress)) {
70157015
current = workInProgress.stateNode;
7016-
var container = current.containerInfo,
7017-
newChildSet = createChildNodeSet();
7016+
var newChildSet = createChildNodeSet();
70187017
appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1);
70197018
current.pendingChildren = newChildSet;
70207019
workInProgress.flags |= 4;
7021-
completeRoot(container.containerTag, newChildSet);
70227020
}
70237021
}
70247022
function scheduleRetryEffect(workInProgress, retryQueue) {
@@ -7679,6 +7677,18 @@ function commitHostMount(finishedWork) {
76797677
captureCommitPhaseError(finishedWork, finishedWork.return, error);
76807678
}
76817679
}
7680+
function commitHostPortalContainerChildren(
7681+
portal,
7682+
finishedWork,
7683+
pendingChildren
7684+
) {
7685+
portal = portal.containerInfo;
7686+
try {
7687+
completeRoot(portal.containerTag, pendingChildren);
7688+
} catch (error) {
7689+
captureCommitPhaseError(finishedWork, finishedWork.return, error);
7690+
}
7691+
}
76827692
var offscreenSubtreeIsHidden = !1,
76837693
offscreenSubtreeWasHidden = !1,
76847694
PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set,
@@ -7917,7 +7927,11 @@ function commitDeletionEffectsOnFiber(
79177927
case 18:
79187928
break;
79197929
case 4:
7920-
createChildNodeSet();
7930+
commitHostPortalContainerChildren(
7931+
deletedFiber.stateNode,
7932+
deletedFiber,
7933+
createChildNodeSet()
7934+
);
79217935
recursivelyTraverseDeletionEffects(
79227936
finishedRoot,
79237937
nearestMountedAncestor,
@@ -8062,9 +8076,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
80628076
null !== finishedWork &&
80638077
((flags = finishedWork.callbacks),
80648078
null !== flags &&
8065-
((current = finishedWork.shared.hiddenCallbacks),
8079+
((root = finishedWork.shared.hiddenCallbacks),
80668080
(finishedWork.shared.hiddenCallbacks =
8067-
null === current ? flags : current.concat(flags)))));
8081+
null === root ? flags : root.concat(flags)))));
80688082
break;
80698083
case 26:
80708084
case 27:
@@ -8085,10 +8099,25 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
80858099
case 3:
80868100
recursivelyTraverseMutationEffects(root, finishedWork);
80878101
commitReconciliationEffects(finishedWork);
8102+
if (flags & 4) {
8103+
flags = root.containerInfo;
8104+
root = root.pendingChildren;
8105+
try {
8106+
completeRoot(flags.containerTag, root);
8107+
} catch (error) {
8108+
captureCommitPhaseError(finishedWork, finishedWork.return, error);
8109+
}
8110+
}
80888111
break;
80898112
case 4:
80908113
recursivelyTraverseMutationEffects(root, finishedWork);
80918114
commitReconciliationEffects(finishedWork);
8115+
flags & 4 &&
8116+
commitHostPortalContainerChildren(
8117+
finishedWork.stateNode,
8118+
finishedWork,
8119+
finishedWork.stateNode.pendingChildren
8120+
);
80928121
break;
80938122
case 12:
80948123
recursivelyTraverseMutationEffects(root, finishedWork);
@@ -8098,9 +8127,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
80988127
recursivelyTraverseMutationEffects(root, finishedWork);
80998128
commitReconciliationEffects(finishedWork);
81008129
finishedWork.child.flags & 8192 &&
8101-
((current = null !== current && null !== current.memoizedState),
8130+
((root = null !== current && null !== current.memoizedState),
81028131
null === finishedWork.memoizedState ||
8103-
current ||
8132+
root ||
81048133
(globalMostRecentFallbackTime = now()));
81058134
flags & 4 &&
81068135
((flags = finishedWork.updateQueue),
@@ -8136,10 +8165,10 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
81368165
flags & 4 &&
81378166
((flags = finishedWork.updateQueue),
81388167
null !== flags &&
8139-
((current = flags.retryQueue),
8140-
null !== current &&
8168+
((root = flags.retryQueue),
8169+
null !== root &&
81418170
((flags.retryQueue = null),
8142-
attachSuspenseRetryListeners(finishedWork, current))));
8171+
attachSuspenseRetryListeners(finishedWork, root))));
81438172
break;
81448173
case 19:
81458174
recursivelyTraverseMutationEffects(root, finishedWork);
@@ -10415,26 +10444,26 @@ batchedUpdatesImpl = function (fn, a) {
1041510444
}
1041610445
};
1041710446
var roots = new Map(),
10418-
internals$jscomp$inline_1206 = {
10447+
internals$jscomp$inline_1203 = {
1041910448
bundleType: 0,
10420-
version: "19.1.0",
10449+
version: "19.1.1",
1042110450
rendererPackageName: "react-native-renderer",
1042210451
currentDispatcherRef: ReactSharedInternals,
10423-
reconcilerVersion: "19.1.0"
10452+
reconcilerVersion: "19.1.1"
1042410453
};
1042510454
null !== extraDevToolsConfig &&
10426-
(internals$jscomp$inline_1206.rendererConfig = extraDevToolsConfig);
10455+
(internals$jscomp$inline_1203.rendererConfig = extraDevToolsConfig);
1042710456
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
10428-
var hook$jscomp$inline_1519 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
10457+
var hook$jscomp$inline_1515 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1042910458
if (
10430-
!hook$jscomp$inline_1519.isDisabled &&
10431-
hook$jscomp$inline_1519.supportsFiber
10459+
!hook$jscomp$inline_1515.isDisabled &&
10460+
hook$jscomp$inline_1515.supportsFiber
1043210461
)
1043310462
try {
10434-
(rendererID = hook$jscomp$inline_1519.inject(
10435-
internals$jscomp$inline_1206
10463+
(rendererID = hook$jscomp$inline_1515.inject(
10464+
internals$jscomp$inline_1203
1043610465
)),
10437-
(injectedHook = hook$jscomp$inline_1519);
10466+
(injectedHook = hook$jscomp$inline_1515);
1043810467
} catch (err) {}
1043910468
}
1044010469
exports.createPortal = function (children, containerTag) {

0 commit comments

Comments
 (0)