From c4f430b33ec3fa9025a9970e21187f305572ee7e Mon Sep 17 00:00:00 2001 From: acdlite Date: Tue, 3 Oct 2023 19:06:46 +0000 Subject: [PATCH] Fix: Optimistic update does not get reset (#27453) I found a bug where if an optimistic update causes a component to rerender, and there are no other state updates during that render, React bails out without applying the update. Whenever a hook detects a change, we must mark the component as dirty to prevent a bailout. We check for changes by comparing the new state to `hook.memoizedState`. However, when implementing optimistic state rebasing, I incorrectly reset `hook.memoizedState` to the incoming base state, even though I only needed to reset `hook.baseState`. This was just a mistake on my part. This wasn't caught by the existing tests because usually when the optimistic state changes, there's also some other state that marks the component as dirty in the same render. I fixed the bug and added a regression test. DiffTrain build for [85c2b519b54269811002d26f4f711809ef68f123](https://github.com/facebook/react/commit/85c2b519b54269811002d26f4f711809ef68f123) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/React-dev.classic.js | 2 +- compiled/facebook-www/React-prod.modern.js | 2 +- compiled/facebook-www/React-profiling.modern.js | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 14 +++++++------- compiled/facebook-www/ReactART-dev.modern.js | 14 +++++++------- compiled/facebook-www/ReactART-prod.classic.js | 8 ++++---- compiled/facebook-www/ReactART-prod.modern.js | 8 ++++---- compiled/facebook-www/ReactDOM-dev.classic.js | 14 +++++++------- compiled/facebook-www/ReactDOM-dev.modern.js | 14 +++++++------- compiled/facebook-www/ReactDOM-prod.classic.js | 10 +++++----- compiled/facebook-www/ReactDOM-prod.modern.js | 10 +++++----- .../facebook-www/ReactDOM-profiling.classic.js | 10 +++++----- compiled/facebook-www/ReactDOM-profiling.modern.js | 10 +++++----- compiled/facebook-www/ReactDOMServer-dev.modern.js | 2 +- .../facebook-www/ReactDOMServer-prod.modern.js | 2 +- .../facebook-www/ReactDOMTesting-dev.classic.js | 14 +++++++------- .../facebook-www/ReactDOMTesting-dev.modern.js | 14 +++++++------- .../facebook-www/ReactDOMTesting-prod.classic.js | 10 +++++----- .../facebook-www/ReactDOMTesting-prod.modern.js | 10 +++++----- 20 files changed, 86 insertions(+), 86 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 00952b518d7e9..d6554cf4d52fd 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -db69f95e4876ec3c24117f58d55cbb4f315b9fa7 +85c2b519b54269811002d26f4f711809ef68f123 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index f24984bde1452..7bb9b46a64342 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-www-classic-136a3d2d"; +var ReactVersion = "18.3.0-www-classic-d32d685e"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index afee9e85c8094..94a2b0bf43813 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -615,4 +615,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-modern-939a7938"; +exports.version = "18.3.0-www-modern-d97fc327"; diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index ce08356995444..0465e4ad3704b 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -626,7 +626,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-modern-de10697a"; +exports.version = "18.3.0-www-modern-7e2c0d38"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 9b073f34e9fce..d9a87febba86c 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-classic-6b865fa6"; +var ReactVersion = "18.3.0-www-classic-86227a5b"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -9296,9 +9296,9 @@ function updateOptimisticImpl(hook, current, passthrough, reducer) { // as an argument. It's called a passthrough because if there are no pending // updates, it will be returned as-is. // - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. - hook.baseState = hook.memoizedState = passthrough; // If a reducer is not provided, default to the same one used by useState. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. + hook.baseState = passthrough; // If a reducer is not provided, default to the same one used by useState. var resolvedReducer = typeof reducer === "function" ? reducer : basicStateReducer; @@ -9319,10 +9319,10 @@ function rerenderOptimistic(passthrough, reducer) { // This is an update. Process the update queue. return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } // This is a mount. No updates to process. - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; var dispatch = hook.queue.dispatch; return [passthrough, dispatch]; } // useFormState actions run sequentially, because each action receives the diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 4add791090348..b9107f79bdec8 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -69,7 +69,7 @@ function _assertThisInitialized(self) { return self; } -var ReactVersion = "18.3.0-www-modern-5845cabd"; +var ReactVersion = "18.3.0-www-modern-cb89a149"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -9052,9 +9052,9 @@ function updateOptimisticImpl(hook, current, passthrough, reducer) { // as an argument. It's called a passthrough because if there are no pending // updates, it will be returned as-is. // - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. - hook.baseState = hook.memoizedState = passthrough; // If a reducer is not provided, default to the same one used by useState. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. + hook.baseState = passthrough; // If a reducer is not provided, default to the same one used by useState. var resolvedReducer = typeof reducer === "function" ? reducer : basicStateReducer; @@ -9075,10 +9075,10 @@ function rerenderOptimistic(passthrough, reducer) { // This is an update. Process the update queue. return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } // This is a mount. No updates to process. - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; var dispatch = hook.queue.dispatch; return [passthrough, dispatch]; } // useFormState actions run sequentially, because each action receives the diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index a7ba2d1cdc067..f9724e4de006d 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -3003,7 +3003,7 @@ function updateOptimistic(passthrough, reducer) { return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return updateReducerImpl( hook, currentHook, @@ -3014,7 +3014,7 @@ function rerenderOptimistic(passthrough, reducer) { var hook = updateWorkInProgressHook(); if (null !== currentHook) return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; } function pushEffect(tag, create, inst, deps) { @@ -10107,7 +10107,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "18.3.0-www-classic-2b1e1230", + version: "18.3.0-www-classic-8867a970", rendererPackageName: "react-art" }; var internals$jscomp$inline_1304 = { @@ -10138,7 +10138,7 @@ var internals$jscomp$inline_1304 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-2b1e1230" + reconcilerVersion: "18.3.0-www-classic-8867a970" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1305 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 848359d4fee7f..06e76e34179f4 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -2809,7 +2809,7 @@ function updateOptimistic(passthrough, reducer) { return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return updateReducerImpl( hook, currentHook, @@ -2820,7 +2820,7 @@ function rerenderOptimistic(passthrough, reducer) { var hook = updateWorkInProgressHook(); if (null !== currentHook) return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; } function pushEffect(tag, create, inst, deps) { @@ -9772,7 +9772,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "18.3.0-www-modern-d368bffd", + version: "18.3.0-www-modern-46965381", rendererPackageName: "react-art" }; var internals$jscomp$inline_1284 = { @@ -9803,7 +9803,7 @@ var internals$jscomp$inline_1284 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-d368bffd" + reconcilerVersion: "18.3.0-www-modern-46965381" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1285 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 736da11f01760..2afa7422591cb 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -13843,9 +13843,9 @@ function updateOptimisticImpl(hook, current, passthrough, reducer) { // as an argument. It's called a passthrough because if there are no pending // updates, it will be returned as-is. // - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. - hook.baseState = hook.memoizedState = passthrough; // If a reducer is not provided, default to the same one used by useState. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. + hook.baseState = passthrough; // If a reducer is not provided, default to the same one used by useState. var resolvedReducer = typeof reducer === "function" ? reducer : basicStateReducer; @@ -13866,10 +13866,10 @@ function rerenderOptimistic(passthrough, reducer) { // This is an update. Process the update queue. return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } // This is a mount. No updates to process. - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; var dispatch = hook.queue.dispatch; return [passthrough, dispatch]; } // useFormState actions run sequentially, because each action receives the @@ -33976,7 +33976,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-85c09bff"; +var ReactVersion = "18.3.0-www-classic-43da500c"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 6bc7857f62c10..ee325db308ec5 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -13784,9 +13784,9 @@ function updateOptimisticImpl(hook, current, passthrough, reducer) { // as an argument. It's called a passthrough because if there are no pending // updates, it will be returned as-is. // - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. - hook.baseState = hook.memoizedState = passthrough; // If a reducer is not provided, default to the same one used by useState. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. + hook.baseState = passthrough; // If a reducer is not provided, default to the same one used by useState. var resolvedReducer = typeof reducer === "function" ? reducer : basicStateReducer; @@ -13807,10 +13807,10 @@ function rerenderOptimistic(passthrough, reducer) { // This is an update. Process the update queue. return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } // This is a mount. No updates to process. - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; var dispatch = hook.queue.dispatch; return [passthrough, dispatch]; } // useFormState actions run sequentially, because each action receives the @@ -33821,7 +33821,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-c7df3b44"; +var ReactVersion = "18.3.0-www-modern-a850f7df"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 1d0f3b470d1cd..6ad632ba77c2a 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -3743,7 +3743,7 @@ function updateOptimistic(passthrough, reducer) { return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return updateReducerImpl( hook, currentHook, @@ -3754,7 +3754,7 @@ function rerenderOptimistic(passthrough, reducer) { var hook = updateWorkInProgressHook(); if (null !== currentHook) return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; } function pushEffect(tag, create, inst, deps) { @@ -16375,7 +16375,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1779 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-a202a369", + version: "18.3.0-www-classic-649be7ad", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2123 = { @@ -16405,7 +16405,7 @@ var internals$jscomp$inline_2123 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-a202a369" + reconcilerVersion: "18.3.0-www-classic-649be7ad" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2124 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16742,4 +16742,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-a202a369"; +exports.version = "18.3.0-www-classic-649be7ad"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 83f1acce1cc71..1926209738cfa 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -3636,7 +3636,7 @@ function updateOptimistic(passthrough, reducer) { return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return updateReducerImpl( hook, currentHook, @@ -3647,7 +3647,7 @@ function rerenderOptimistic(passthrough, reducer) { var hook = updateWorkInProgressHook(); if (null !== currentHook) return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; } function pushEffect(tag, create, inst, deps) { @@ -15897,7 +15897,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1738 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-7e008df6", + version: "18.3.0-www-modern-ea5134e6", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2087 = { @@ -15928,7 +15928,7 @@ var internals$jscomp$inline_2087 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-7e008df6" + reconcilerVersion: "18.3.0-www-modern-ea5134e6" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2088 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16193,4 +16193,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-7e008df6"; +exports.version = "18.3.0-www-modern-ea5134e6"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index e45299898dc85..aef821b56604a 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -3889,7 +3889,7 @@ function updateOptimistic(passthrough, reducer) { return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return updateReducerImpl( hook, currentHook, @@ -3900,7 +3900,7 @@ function rerenderOptimistic(passthrough, reducer) { var hook = updateWorkInProgressHook(); if (null !== currentHook) return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; } function pushEffect(tag, create, inst, deps) { @@ -17150,7 +17150,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1864 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-bf660d13", + version: "18.3.0-www-classic-ea6b16b5", rendererPackageName: "react-dom" }; (function (internals) { @@ -17194,7 +17194,7 @@ var devToolsConfig$jscomp$inline_1864 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-bf660d13" + reconcilerVersion: "18.3.0-www-classic-ea6b16b5" }); assign(Internals, { ReactBrowserEventEmitter: { @@ -17518,7 +17518,7 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-bf660d13"; +exports.version = "18.3.0-www-classic-ea6b16b5"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index baa8e8757fe37..9b13aec4cb6de 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -3782,7 +3782,7 @@ function updateOptimistic(passthrough, reducer) { return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return updateReducerImpl( hook, currentHook, @@ -3793,7 +3793,7 @@ function rerenderOptimistic(passthrough, reducer) { var hook = updateWorkInProgressHook(); if (null !== currentHook) return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; } function pushEffect(tag, create, inst, deps) { @@ -16666,7 +16666,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1823 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-9d2908e6", + version: "18.3.0-www-modern-bff6f39a", rendererPackageName: "react-dom" }; (function (internals) { @@ -16711,7 +16711,7 @@ var devToolsConfig$jscomp$inline_1823 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-9d2908e6" + reconcilerVersion: "18.3.0-www-modern-bff6f39a" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = function (children, container) { @@ -16963,7 +16963,7 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-9d2908e6"; +exports.version = "18.3.0-www-modern-bff6f39a"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 9d1b2e46a9693..e078fc1a0ad73 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); -var ReactVersion = "18.3.0-www-modern-5845cabd"; +var ReactVersion = "18.3.0-www-modern-cb89a149"; // This refers to a WWW module. var warningWWW = require("warning"); diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index 448ebdddf5bb2..6ddb9034d8ed7 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -4965,4 +4965,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "18.3.0-www-modern-d368bffd"; +exports.version = "18.3.0-www-modern-46965381"; diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 60c2837dcf884..554463583d6bd 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -13977,9 +13977,9 @@ function updateOptimisticImpl(hook, current, passthrough, reducer) { // as an argument. It's called a passthrough because if there are no pending // updates, it will be returned as-is. // - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. - hook.baseState = hook.memoizedState = passthrough; // If a reducer is not provided, default to the same one used by useState. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. + hook.baseState = passthrough; // If a reducer is not provided, default to the same one used by useState. var resolvedReducer = typeof reducer === "function" ? reducer : basicStateReducer; @@ -14000,10 +14000,10 @@ function rerenderOptimistic(passthrough, reducer) { // This is an update. Process the update queue. return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } // This is a mount. No updates to process. - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; var dispatch = hook.queue.dispatch; return [passthrough, dispatch]; } // useFormState actions run sequentially, because each action receives the @@ -34593,7 +34593,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-classic-32c273fd"; +var ReactVersion = "18.3.0-www-classic-7b09e670"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index b3b5d8c5a1914..fccc0b003fbc4 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -13918,9 +13918,9 @@ function updateOptimisticImpl(hook, current, passthrough, reducer) { // as an argument. It's called a passthrough because if there are no pending // updates, it will be returned as-is. // - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. - hook.baseState = hook.memoizedState = passthrough; // If a reducer is not provided, default to the same one used by useState. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. + hook.baseState = passthrough; // If a reducer is not provided, default to the same one used by useState. var resolvedReducer = typeof reducer === "function" ? reducer : basicStateReducer; @@ -13941,10 +13941,10 @@ function rerenderOptimistic(passthrough, reducer) { // This is an update. Process the update queue. return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } // This is a mount. No updates to process. - // Reset the base state and memoized state to the passthrough. Future - // updates will be applied on top of this. + // Reset the base state to the passthrough. Future updates will be applied + // on top of this. - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; var dispatch = hook.queue.dispatch; return [passthrough, dispatch]; } // useFormState actions run sequentially, because each action receives the @@ -34438,7 +34438,7 @@ function createFiberRoot( return root; } -var ReactVersion = "18.3.0-www-modern-939a7938"; +var ReactVersion = "18.3.0-www-modern-d97fc327"; function createPortal$1( children, diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index b92e864610d6d..e37dcaef30908 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -3829,7 +3829,7 @@ function updateOptimistic(passthrough, reducer) { return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return updateReducerImpl( hook, currentHook, @@ -3840,7 +3840,7 @@ function rerenderOptimistic(passthrough, reducer) { var hook = updateWorkInProgressHook(); if (null !== currentHook) return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; } function pushEffect(tag, create, inst, deps) { @@ -16704,7 +16704,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1808 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-136a3d2d", + version: "18.3.0-www-classic-d32d685e", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2157 = { @@ -16734,7 +16734,7 @@ var internals$jscomp$inline_2157 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-136a3d2d" + reconcilerVersion: "18.3.0-www-classic-d32d685e" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2158 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -17222,4 +17222,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-136a3d2d"; +exports.version = "18.3.0-www-classic-d32d685e"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index b2000fdc4b42e..f41e519d5d122 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -3777,7 +3777,7 @@ function updateOptimistic(passthrough, reducer) { return updateOptimisticImpl(hook, currentHook, passthrough, reducer); } function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return updateReducerImpl( hook, currentHook, @@ -3788,7 +3788,7 @@ function rerenderOptimistic(passthrough, reducer) { var hook = updateWorkInProgressHook(); if (null !== currentHook) return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = hook.memoizedState = passthrough; + hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; } function pushEffect(tag, create, inst, deps) { @@ -16281,7 +16281,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1767 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-modern-de10697a", + version: "18.3.0-www-modern-7e2c0d38", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2121 = { @@ -16312,7 +16312,7 @@ var internals$jscomp$inline_2121 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-modern-de10697a" + reconcilerVersion: "18.3.0-www-modern-7e2c0d38" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2122 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16728,4 +16728,4 @@ exports.unstable_createEventHandle = function (type, options) { return eventHandle; }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-modern-de10697a"; +exports.version = "18.3.0-www-modern-7e2c0d38";