Compare name when hydrating hidden fields to filter out extra form action fields (#26846)

This solves an issue where if you inject a hidden field in the beginning
of the form, we might mistakenly hydrate the injected one that was part
of an action.

I'm not too happy about how specific this becomes. It's similar to Float
but in general we don't do this deep comparison.

See https://github.com/vercel/next.js/issues/50087

DiffTrain build for commit https://github.com/facebook/react/commit/a1f97589fd298cd71f97339a230f016139c7382f.
This commit is contained in:
sebmarkbage
2023-05-26 16:58:39 +00:00
parent f3bd734469
commit 67de87bc01
7 changed files with 9 additions and 9 deletions
@@ -23930,7 +23930,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-canary-0210f0b08-20230525";
var ReactVersion = "18.3.0-canary-a1f97589f-20230526";
// Might add PROFILE later.
@@ -8617,7 +8617,7 @@ var devToolsConfig$jscomp$inline_1036 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-0210f0b08-20230525",
version: "18.3.0-canary-a1f97589f-20230526",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1235 = {
@@ -8648,7 +8648,7 @@ var internals$jscomp$inline_1235 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-0210f0b08-20230525"
reconcilerVersion: "18.3.0-canary-a1f97589f-20230526"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1236 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9043,7 +9043,7 @@ var devToolsConfig$jscomp$inline_1078 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-0210f0b08-20230525",
version: "18.3.0-canary-a1f97589f-20230526",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1276 = {
@@ -9074,7 +9074,7 @@ var internals$jscomp$inline_1276 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-0210f0b08-20230525"
reconcilerVersion: "18.3.0-canary-a1f97589f-20230526"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1277 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-canary-0210f0b08-20230525";
var ReactVersion = "18.3.0-canary-a1f97589f-20230526";
// ATTENTION
// When adding new symbols to this file,
@@ -642,4 +642,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-canary-0210f0b08-20230525";
exports.version = "18.3.0-canary-a1f97589f-20230526";
@@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-canary-0210f0b08-20230525";
exports.version = "18.3.0-canary-a1f97589f-20230526";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -1 +1 @@
0210f0b082c95f5aec08f356d796c512eab44fc4
a1f97589fd298cd71f97339a230f016139c7382f