Insert temporary input node to polyfill submitter argument in FormData (#26714)

Insert temporary input node to polyfill submitter argument in FormData.
This works for buttons too and fixes a bug where the type attribute
wasn't reset.

I also exclude the submitter if it's a function action. This ensures
that we don't include the generated "name" when the action is a server
action. Conceptually that name doesn't exist.

DiffTrain build for commit https://github.com/facebook/react/commit/5e5342b10059bf90738a8d9171fcf0af9d9d5d51.
This commit is contained in:
sebmarkbage
2023-04-24 18:22:48 +00:00
parent 07f11fb12b
commit 34d8134513
13 changed files with 19 additions and 19 deletions
@@ -23824,7 +23824,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-9c58a0b64-20230424";
var ReactVersion = "18.3.0-next-5e5342b10-20230424";
// Might add PROFILE later.
@@ -8601,7 +8601,7 @@ var devToolsConfig$jscomp$inline_1021 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-9c58a0b64-20230424",
version: "18.3.0-next-5e5342b10-20230424",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1206 = {
@@ -8632,7 +8632,7 @@ var internals$jscomp$inline_1206 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-9c58a0b64-20230424"
reconcilerVersion: "18.3.0-next-5e5342b10-20230424"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1207 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9027,7 +9027,7 @@ var devToolsConfig$jscomp$inline_1063 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-9c58a0b64-20230424",
version: "18.3.0-next-5e5342b10-20230424",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1247 = {
@@ -9058,7 +9058,7 @@ var internals$jscomp$inline_1247 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-9c58a0b64-20230424"
reconcilerVersion: "18.3.0-next-5e5342b10-20230424"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1248 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-next-9c58a0b64-20230424";
var ReactVersion = "18.3.0-next-5e5342b10-20230424";
// ATTENTION
// When adding new symbols to this file,
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-9c58a0b64-20230424";
exports.version = "18.3.0-next-5e5342b10-20230424";
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-9c58a0b64-20230424";
exports.version = "18.3.0-next-5e5342b10-20230424";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -1 +1 @@
9c58a0b6475509f9124da578207aa0d3b7364035
5e5342b10059bf90738a8d9171fcf0af9d9d5d51
@@ -27134,7 +27134,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-9c58a0b64-20230424";
var ReactVersion = "18.3.0-next-5e5342b10-20230424";
function createPortal$1(
children,
@@ -9472,7 +9472,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1045 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-9c58a0b64-20230424",
version: "18.3.0-next-5e5342b10-20230424",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -9514,7 +9514,7 @@ var internals$jscomp$inline_1276 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-9c58a0b64-20230424"
reconcilerVersion: "18.3.0-next-5e5342b10-20230424"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1277 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10181,7 +10181,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1123 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-9c58a0b64-20230424",
version: "18.3.0-next-5e5342b10-20230424",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -10236,7 +10236,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-9c58a0b64-20230424"
reconcilerVersion: "18.3.0-next-5e5342b10-20230424"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
@@ -27647,7 +27647,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-9c58a0b64-20230424";
var ReactVersion = "18.3.0-next-5e5342b10-20230424";
function createPortal$1(
children,
@@ -9731,7 +9731,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1100 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-9c58a0b64-20230424",
version: "18.3.0-next-5e5342b10-20230424",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -9773,7 +9773,7 @@ var internals$jscomp$inline_1345 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-9c58a0b64-20230424"
reconcilerVersion: "18.3.0-next-5e5342b10-20230424"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1346 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10440,7 +10440,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1178 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-9c58a0b64-20230424",
version: "18.3.0-next-5e5342b10-20230424",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -10495,7 +10495,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-9c58a0b64-20230424"
reconcilerVersion: "18.3.0-next-5e5342b10-20230424"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {