Skip to content

Commit

Permalink
Don't update textarea defaultValue and input checked unnecessarily (#…
Browse files Browse the repository at this point in the history
…26580)

In #26573 I changed it so that textareas get their defaultValue reset if
you don't specify one.

However, the way that was implemented, it always set it for any update
even if it hasn't changed.

We have a test for that, but that test only works if no properties
update at all so that no update was scheduled. This fixes the test so
that it updates some unrelated prop.

I also found a test for `checked` that needed a similar fix.

Interestingly, we don't do this deduping for `defaultValue` or
`defaultChecked` on inputs and there's no test for that.

DiffTrain build for commit 9a9da77.
  • Loading branch information
sebmarkbage committed Apr 10, 2023
1 parent a00c8ed commit 737b75e
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23888,7 +23888,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-e5146cb52-20230409";
var ReactVersion = "18.3.0-next-9a9da7721-20230409";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8688,7 +8688,7 @@ var devToolsConfig$jscomp$inline_1028 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-e5146cb52-20230409",
version: "18.3.0-next-9a9da7721-20230409",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1220 = {
Expand Down Expand Up @@ -8719,7 +8719,7 @@ var internals$jscomp$inline_1220 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-e5146cb52-20230409"
reconcilerVersion: "18.3.0-next-9a9da7721-20230409"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1221 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9114,7 +9114,7 @@ var devToolsConfig$jscomp$inline_1070 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-e5146cb52-20230409",
version: "18.3.0-next-9a9da7721-20230409",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1261 = {
Expand Down Expand Up @@ -9145,7 +9145,7 @@ var internals$jscomp$inline_1261 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-e5146cb52-20230409"
reconcilerVersion: "18.3.0-next-9a9da7721-20230409"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1262 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-next-e5146cb52-20230409";
var ReactVersion = "18.3.0-next-9a9da7721-20230409";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-e5146cb52-20230409";
exports.version = "18.3.0-next-9a9da7721-20230409";
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-e5146cb52-20230409";
exports.version = "18.3.0-next-9a9da7721-20230409";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e5146cb5250be1a4e66511af91549859b36ed488
9a9da7721e5b73a8af242807e463e2af842c58ee
Original file line number Diff line number Diff line change
Expand Up @@ -27184,7 +27184,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-e5146cb52-20230409";
var ReactVersion = "18.3.0-next-9a9da7721-20230409";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9555,7 +9555,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1052 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-e5146cb52-20230409",
version: "18.3.0-next-9a9da7721-20230409",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -9597,7 +9597,7 @@ var internals$jscomp$inline_1297 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-e5146cb52-20230409"
reconcilerVersion: "18.3.0-next-9a9da7721-20230409"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1298 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10264,7 +10264,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1130 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-e5146cb52-20230409",
version: "18.3.0-next-9a9da7721-20230409",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -10319,7 +10319,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-e5146cb52-20230409"
reconcilerVersion: "18.3.0-next-9a9da7721-20230409"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27705,7 +27705,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-e5146cb52-20230409";
var ReactVersion = "18.3.0-next-9a9da7721-20230409";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9815,7 +9815,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1107 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-e5146cb52-20230409",
version: "18.3.0-next-9a9da7721-20230409",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -9857,7 +9857,7 @@ var internals$jscomp$inline_1359 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-e5146cb52-20230409"
reconcilerVersion: "18.3.0-next-9a9da7721-20230409"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1360 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10524,7 +10524,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1185 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-e5146cb52-20230409",
version: "18.3.0-next-9a9da7721-20230409",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -10579,7 +10579,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-e5146cb52-20230409"
reconcilerVersion: "18.3.0-next-9a9da7721-20230409"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit 737b75e

Please sign in to comment.