Skip to content

Commit

Permalink
Warn for useFormState on initial render (#30292)
Browse files Browse the repository at this point in the history
This was missed in the mount dev dispatcher. It was only in the rerender
dispatcher which means that it was only logged during the rerender.
Since DevTools can hide logs during rerenders, this hid the warning in
StrictMode.

DiffTrain build for [274c980](274c980)
  • Loading branch information
sebmarkbage committed Jul 8, 2024
1 parent d255e1a commit 14213c5
Show file tree
Hide file tree
Showing 34 changed files with 90 additions and 80 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
df783f9ea1b6f95e05f830602da1de5ffb325d30
274c980c535bb34e17f5d97cc22ef4dd296ab413
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
df783f9ea1b6f95e05f830602da1de5ffb325d30
274c980c535bb34e17f5d97cc22ef4dd296ab413
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-classic-df783f9ea1-20240708";
exports.version = "19.0.0-www-classic-274c980c53-20240708";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.0.0-www-modern-df783f9ea1-20240708";
exports.version = "19.0.0-www-modern-274c980c53-20240708";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-df783f9ea1-20240708";
exports.version = "19.0.0-www-classic-274c980c53-20240708";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-df783f9ea1-20240708";
exports.version = "19.0.0-www-modern-274c980c53-20240708";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-df783f9ea1-20240708";
exports.version = "19.0.0-www-classic-274c980c53-20240708";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-df783f9ea1-20240708";
exports.version = "19.0.0-www-modern-274c980c53-20240708";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
5 changes: 3 additions & 2 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15517,6 +15517,7 @@ __DEV__ &&
HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) {
currentHookNameInDev = "useFormState";
mountHookTypesDev();
warnOnUseFormStateInDev();
return mountActionState(action, initialState);
};
HooksDispatcherOnMountInDEV.useActionState = function (
Expand Down Expand Up @@ -16941,14 +16942,14 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-classic-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-classic-274c980c53-20240708"
});
})({
findFiberByHostInstance: function () {
return null;
},
bundleType: 1,
version: "19.0.0-www-classic-df783f9ea1-20240708",
version: "19.0.0-www-classic-274c980c53-20240708",
rendererPackageName: "react-art"
});
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,
Expand Down
5 changes: 3 additions & 2 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -14949,6 +14949,7 @@ __DEV__ &&
HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) {
currentHookNameInDev = "useFormState";
mountHookTypesDev();
warnOnUseFormStateInDev();
return mountActionState(action, initialState);
};
HooksDispatcherOnMountInDEV.useActionState = function (
Expand Down Expand Up @@ -16371,14 +16372,14 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-modern-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-modern-274c980c53-20240708"
});
})({
findFiberByHostInstance: function () {
return null;
},
bundleType: 1,
version: "19.0.0-www-modern-df783f9ea1-20240708",
version: "19.0.0-www-modern-274c980c53-20240708",
rendererPackageName: "react-art"
});
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10718,7 +10718,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-classic-df783f9ea1-20240708",
version: "19.0.0-www-classic-274c980c53-20240708",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1386 = {
Expand Down Expand Up @@ -10749,7 +10749,7 @@ var internals$jscomp$inline_1386 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-classic-274c980c53-20240708"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1387 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10171,7 +10171,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-modern-df783f9ea1-20240708",
version: "19.0.0-www-modern-274c980c53-20240708",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1372 = {
Expand Down Expand Up @@ -10202,7 +10202,7 @@ var internals$jscomp$inline_1372 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-modern-274c980c53-20240708"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1373 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
11 changes: 6 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -25334,6 +25334,7 @@ __DEV__ &&
HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) {
currentHookNameInDev = "useFormState";
mountHookTypesDev();
warnOnUseFormStateInDev();
return mountActionState(action, initialState);
};
HooksDispatcherOnMountInDEV.useActionState = function (
Expand Down Expand Up @@ -27377,11 +27378,11 @@ __DEV__ &&
: flushSyncErrorInBuildsThatSupportLegacyMode;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-classic-df783f9ea1-20240708" !== isomorphicReactPackageVersion)
if ("19.0.0-www-classic-274c980c53-20240708" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-classic-df783f9ea1-20240708\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-classic-274c980c53-20240708\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27447,12 +27448,12 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-classic-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-classic-274c980c53-20240708"
});
})({
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 1,
version: "19.0.0-www-classic-df783f9ea1-20240708",
version: "19.0.0-www-classic-274c980c53-20240708",
rendererPackageName: "react-dom"
}) &&
canUseDOM &&
Expand Down Expand Up @@ -28095,7 +28096,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-df783f9ea1-20240708";
exports.version = "19.0.0-www-classic-274c980c53-20240708";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
11 changes: 6 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -24483,6 +24483,7 @@ __DEV__ &&
HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) {
currentHookNameInDev = "useFormState";
mountHookTypesDev();
warnOnUseFormStateInDev();
return mountActionState(action, initialState);
};
HooksDispatcherOnMountInDEV.useActionState = function (
Expand Down Expand Up @@ -26524,11 +26525,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-www-modern-df783f9ea1-20240708" !== isomorphicReactPackageVersion)
if ("19.0.0-www-modern-274c980c53-20240708" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-www-modern-df783f9ea1-20240708\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-www-modern-274c980c53-20240708\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26593,12 +26594,12 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-www-modern-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-modern-274c980c53-20240708"
});
})({
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 1,
version: "19.0.0-www-modern-df783f9ea1-20240708",
version: "19.0.0-www-modern-274c980c53-20240708",
rendererPackageName: "react-dom"
}) &&
canUseDOM &&
Expand Down Expand Up @@ -27194,7 +27195,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-df783f9ea1-20240708";
exports.version = "19.0.0-www-modern-274c980c53-20240708";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17163,14 +17163,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1769 = React.version;
if (
"19.0.0-www-classic-df783f9ea1-20240708" !==
"19.0.0-www-classic-274c980c53-20240708" !==
isomorphicReactPackageVersion$jscomp$inline_1769
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1769,
"19.0.0-www-classic-df783f9ea1-20240708"
"19.0.0-www-classic-274c980c53-20240708"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -17216,7 +17216,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1776 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-df783f9ea1-20240708",
version: "19.0.0-www-classic-274c980c53-20240708",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2220 = {
Expand Down Expand Up @@ -17246,7 +17246,7 @@ var internals$jscomp$inline_2220 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-classic-274c980c53-20240708"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2221 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17710,4 +17710,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-df783f9ea1-20240708";
exports.version = "19.0.0-www-classic-274c980c53-20240708";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16478,14 +16478,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1740 = React.version;
if (
"19.0.0-www-modern-df783f9ea1-20240708" !==
"19.0.0-www-modern-274c980c53-20240708" !==
isomorphicReactPackageVersion$jscomp$inline_1740
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1740,
"19.0.0-www-modern-df783f9ea1-20240708"
"19.0.0-www-modern-274c980c53-20240708"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -16504,7 +16504,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1742 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-modern-df783f9ea1-20240708",
version: "19.0.0-www-modern-274c980c53-20240708",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2211 = {
Expand Down Expand Up @@ -16534,7 +16534,7 @@ var internals$jscomp$inline_2211 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-modern-274c980c53-20240708"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2212 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16905,4 +16905,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-modern-df783f9ea1-20240708";
exports.version = "19.0.0-www-modern-274c980c53-20240708";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17930,14 +17930,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1856 = React.version;
if (
"19.0.0-www-classic-df783f9ea1-20240708" !==
"19.0.0-www-classic-274c980c53-20240708" !==
isomorphicReactPackageVersion$jscomp$inline_1856
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1856,
"19.0.0-www-classic-df783f9ea1-20240708"
"19.0.0-www-classic-274c980c53-20240708"
)
);
function flushSyncFromReconciler(fn) {
Expand Down Expand Up @@ -17983,7 +17983,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1863 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "19.0.0-www-classic-df783f9ea1-20240708",
version: "19.0.0-www-classic-274c980c53-20240708",
rendererPackageName: "react-dom"
};
(function (internals) {
Expand Down Expand Up @@ -18027,7 +18027,7 @@ var devToolsConfig$jscomp$inline_1863 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-df783f9ea1-20240708"
reconcilerVersion: "19.0.0-www-classic-274c980c53-20240708"
});
function ReactDOMRoot(internalRoot) {
this._internalRoot = internalRoot;
Expand Down Expand Up @@ -18478,7 +18478,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-www-classic-df783f9ea1-20240708";
exports.version = "19.0.0-www-classic-274c980c53-20240708";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 14213c5

Please sign in to comment.