Skip to content

Commit 6e5eaa6

Browse files
committed
Ensure dispatch from useFormState works in StrictMode (#28557)
Co-authored-by: Andrew Clark <[email protected]> DiffTrain build for [8ef14cf](8ef14cf)
1 parent cc0b6cd commit 6e5eaa6

19 files changed

+73
-41
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
83409a1fdd14b2e5b33c587935a7ef552607780f
1+
8ef14cf24219addedca3607dabb3bef37fb2e013

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,4 +633,4 @@ exports.useSyncExternalStore = function (
633633
exports.useTransition = function () {
634634
return ReactCurrentDispatcher.current.useTransition();
635635
};
636-
exports.version = "18.3.0-www-classic-829f825d";
636+
exports.version = "18.3.0-www-classic-53d5188c";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ exports.useSyncExternalStore = function (
637637
exports.useTransition = function () {
638638
return ReactCurrentDispatcher.current.useTransition();
639639
};
640-
exports.version = "18.3.0-www-classic-29031ba7";
640+
exports.version = "18.3.0-www-classic-062d5c9c";
641641
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
642642
"function" ===
643643
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-classic-a2c6275a";
69+
var ReactVersion = "18.3.0-www-classic-b5b1b06a";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -10157,7 +10157,10 @@ if (__DEV__) {
1015710157
if (currentStateHook !== null) {
1015810158
// This is an update. Process the update queue.
1015910159
return updateFormStateImpl(stateHook, currentStateHook, action);
10160-
} // This is a mount. No updates to process.
10160+
}
10161+
10162+
updateWorkInProgressHook(); // State
10163+
// This is a mount. No updates to process.
1016110164

1016210165
var state = stateHook.memoizedState;
1016310166
var actionQueueHook = updateWorkInProgressHook();

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-modern-f2f5c035";
69+
var ReactVersion = "18.3.0-www-modern-9382a497";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -9922,7 +9922,10 @@ if (__DEV__) {
99229922
if (currentStateHook !== null) {
99239923
// This is an update. Process the update queue.
99249924
return updateFormStateImpl(stateHook, currentStateHook, action);
9925-
} // This is a mount. No updates to process.
9925+
}
9926+
9927+
updateWorkInProgressHook(); // State
9928+
// This is a mount. No updates to process.
99269929

99279930
var state = stateHook.memoizedState;
99289931
var actionQueueHook = updateWorkInProgressHook();

compiled/facebook-www/ReactART-prod.classic.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3852,6 +3852,7 @@ HooksDispatcherOnRerender.useFormState = function (action) {
38523852
currentStateHook = currentHook;
38533853
if (null !== currentStateHook)
38543854
return updateFormStateImpl(stateHook, currentStateHook, action);
3855+
updateWorkInProgressHook();
38553856
stateHook = stateHook.memoizedState;
38563857
currentStateHook = updateWorkInProgressHook();
38573858
var dispatch = currentStateHook.queue.dispatch;
@@ -10628,7 +10629,7 @@ var slice = Array.prototype.slice,
1062810629
return null;
1062910630
},
1063010631
bundleType: 0,
10631-
version: "18.3.0-www-classic-d82b0a84",
10632+
version: "18.3.0-www-classic-b6fe280b",
1063210633
rendererPackageName: "react-art"
1063310634
};
1063410635
var internals$jscomp$inline_1320 = {
@@ -10659,7 +10660,7 @@ var internals$jscomp$inline_1320 = {
1065910660
scheduleRoot: null,
1066010661
setRefreshHandler: null,
1066110662
getCurrentFiber: null,
10662-
reconcilerVersion: "18.3.0-www-classic-d82b0a84"
10663+
reconcilerVersion: "18.3.0-www-classic-b6fe280b"
1066310664
};
1066410665
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1066510666
var hook$jscomp$inline_1321 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactART-prod.modern.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3648,6 +3648,7 @@ HooksDispatcherOnRerender.useFormState = function (action) {
36483648
currentStateHook = currentHook;
36493649
if (null !== currentStateHook)
36503650
return updateFormStateImpl(stateHook, currentStateHook, action);
3651+
updateWorkInProgressHook();
36513652
stateHook = stateHook.memoizedState;
36523653
currentStateHook = updateWorkInProgressHook();
36533654
var dispatch = currentStateHook.queue.dispatch;
@@ -10283,7 +10284,7 @@ var slice = Array.prototype.slice,
1028310284
return null;
1028410285
},
1028510286
bundleType: 0,
10286-
version: "18.3.0-www-modern-1cdbdb89",
10287+
version: "18.3.0-www-modern-6da8975f",
1028710288
rendererPackageName: "react-art"
1028810289
};
1028910290
var internals$jscomp$inline_1300 = {
@@ -10314,7 +10315,7 @@ var internals$jscomp$inline_1300 = {
1031410315
scheduleRoot: null,
1031510316
setRefreshHandler: null,
1031610317
getCurrentFiber: null,
10317-
reconcilerVersion: "18.3.0-www-modern-1cdbdb89"
10318+
reconcilerVersion: "18.3.0-www-modern-6da8975f"
1031810319
};
1031910320
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1032010321
var hook$jscomp$inline_1301 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactDOM-dev.classic.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14994,7 +14994,10 @@ if (__DEV__) {
1499414994
if (currentStateHook !== null) {
1499514995
// This is an update. Process the update queue.
1499614996
return updateFormStateImpl(stateHook, currentStateHook, action);
14997-
} // This is a mount. No updates to process.
14997+
}
14998+
14999+
updateWorkInProgressHook(); // State
15000+
// This is a mount. No updates to process.
1499815001

1499915002
var state = stateHook.memoizedState;
1500015003
var actionQueueHook = updateWorkInProgressHook();
@@ -35787,7 +35790,7 @@ if (__DEV__) {
3578735790
return root;
3578835791
}
3578935792

35790-
var ReactVersion = "18.3.0-www-classic-e5fe653a";
35793+
var ReactVersion = "18.3.0-www-classic-abd3d458";
3579135794

3579235795
function createPortal$1(
3579335796
children,

compiled/facebook-www/ReactDOM-dev.modern.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14956,7 +14956,10 @@ if (__DEV__) {
1495614956
if (currentStateHook !== null) {
1495714957
// This is an update. Process the update queue.
1495814958
return updateFormStateImpl(stateHook, currentStateHook, action);
14959-
} // This is a mount. No updates to process.
14959+
}
14960+
14961+
updateWorkInProgressHook(); // State
14962+
// This is a mount. No updates to process.
1496014963

1496114964
var state = stateHook.memoizedState;
1496214965
var actionQueueHook = updateWorkInProgressHook();
@@ -35634,7 +35637,7 @@ if (__DEV__) {
3563435637
return root;
3563535638
}
3563635639

35637-
var ReactVersion = "18.3.0-www-modern-a3956207";
35640+
var ReactVersion = "18.3.0-www-modern-bbd6e896";
3563835641

3563935642
function createPortal$1(
3564035643
children,

compiled/facebook-www/ReactDOM-prod.classic.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4725,6 +4725,7 @@ HooksDispatcherOnRerender.useFormState = function (action) {
47254725
currentStateHook = currentHook;
47264726
if (null !== currentStateHook)
47274727
return updateFormStateImpl(stateHook, currentStateHook, action);
4728+
updateWorkInProgressHook();
47284729
stateHook = stateHook.memoizedState;
47294730
currentStateHook = updateWorkInProgressHook();
47304731
var dispatch = currentStateHook.queue.dispatch;
@@ -17236,7 +17237,7 @@ Internals.Events = [
1723617237
var devToolsConfig$jscomp$inline_1817 = {
1723717238
findFiberByHostInstance: getClosestInstanceFromNode,
1723817239
bundleType: 0,
17239-
version: "18.3.0-www-classic-aafdf38d",
17240+
version: "18.3.0-www-classic-907e805e",
1724017241
rendererPackageName: "react-dom"
1724117242
};
1724217243
var internals$jscomp$inline_2176 = {
@@ -17266,7 +17267,7 @@ var internals$jscomp$inline_2176 = {
1726617267
scheduleRoot: null,
1726717268
setRefreshHandler: null,
1726817269
getCurrentFiber: null,
17269-
reconcilerVersion: "18.3.0-www-classic-aafdf38d"
17270+
reconcilerVersion: "18.3.0-www-classic-907e805e"
1727017271
};
1727117272
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1727217273
var hook$jscomp$inline_2177 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17597,4 +17598,4 @@ exports.useFormState = function (action, initialState, permalink) {
1759717598
exports.useFormStatus = function () {
1759817599
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
1759917600
};
17600-
exports.version = "18.3.0-www-classic-aafdf38d";
17601+
exports.version = "18.3.0-www-classic-907e805e";

0 commit comments

Comments
 (0)