Bugfix: useDeferredValue loop during popstate transition (#27559)

During a popstate event, we attempt to render updates synchronously even
if they are transitions, to preserve scroll position if possible. We do
this by entangling the transition lane with the Sync lane.

However, if rendering the transition spawns additional transition
updates (e.g. a setState inside useEffect), there's no reason to render
those synchronously, too. We should use the normal transition behavior.

This fixes an issue where useDeferredValue during a popstate event would
spawn a transition update that was itself also synchronous.

DiffTrain build for commit https://github.com/facebook/react/commit/6db7f4209e6f32ebde298a0b7451710dd6aa3e19.
This commit is contained in:
acdlite
2023-10-21 16:16:10 +00:00
parent 064c29c2a0
commit faf027aa53
7 changed files with 9 additions and 9 deletions
@@ -24878,7 +24878,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-canary-90172d12e-20231020";
var ReactVersion = "18.3.0-canary-6db7f4209-20231021";
// Might add PROFILE later.
@@ -9022,7 +9022,7 @@ var devToolsConfig$jscomp$inline_1031 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-90172d12e-20231020",
version: "18.3.0-canary-6db7f4209-20231021",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1224 = {
@@ -9053,7 +9053,7 @@ var internals$jscomp$inline_1224 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-90172d12e-20231020"
reconcilerVersion: "18.3.0-canary-6db7f4209-20231021"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1225 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9448,7 +9448,7 @@ var devToolsConfig$jscomp$inline_1073 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-90172d12e-20231020",
version: "18.3.0-canary-6db7f4209-20231021",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1265 = {
@@ -9479,7 +9479,7 @@ var internals$jscomp$inline_1265 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-90172d12e-20231020"
reconcilerVersion: "18.3.0-canary-6db7f4209-20231021"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1266 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-canary-90172d12e-20231020";
var ReactVersion = "18.3.0-canary-6db7f4209-20231021";
// ATTENTION
// When adding new symbols to this file,
@@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-90172d12e-20231020";
exports.version = "18.3.0-canary-6db7f4209-20231021";
@@ -583,7 +583,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-90172d12e-20231020";
exports.version = "18.3.0-canary-6db7f4209-20231021";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -1 +1 @@
90172d12e8f06936ade78ed916397c16a2bec4f8
6db7f4209e6f32ebde298a0b7451710dd6aa3e19