mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[Fizz] Do not reinsert stylesheets after initial insert (#27586)
The loading state tracking for suspensey CSS is too complicated. Prior to this change it had a state it could enter into where a stylesheet was already in the DOM but the loading state did not know it was inserted causing a later transition to try to insert it again. This fix is to add proper tracking of insertions on the codepaths that were missing it. It also modifies the logic of when to suspend based on whether the stylesheet has already been inserted or not. This is not 100% correct semantics however because a prior commit could have inserted a stylesheet and a later transition should ideally be able to wait on that load before committing. I haven't attempted to fix this yet however because the loading state tracking is too complicated as it is and requires a more thorough refactor. Additionally it's not particularly valuable to delay a transition on a loading stylesheet when a previous commit also relied on that stylesheet but didn't wait for it b/c it was sync. I will follow up with an improvement PR later fixes: https://github.com/facebook/react/issues/27585 DiffTrain build for commit https://github.com/facebook/react/commit/a9985529f1aa55477f0feafe2398d36707cf6108.
This commit is contained in:
+1
-1
@@ -24887,7 +24887,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-canary-51ffd3564-20231025";
|
||||
var ReactVersion = "18.3.0-canary-a9985529f-20231025";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
+2
-2
@@ -9025,7 +9025,7 @@ var devToolsConfig$jscomp$inline_1032 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-51ffd3564-20231025",
|
||||
version: "18.3.0-canary-a9985529f-20231025",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1225 = {
|
||||
@@ -9056,7 +9056,7 @@ var internals$jscomp$inline_1225 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-51ffd3564-20231025"
|
||||
reconcilerVersion: "18.3.0-canary-a9985529f-20231025"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1226 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+2
-2
@@ -9451,7 +9451,7 @@ var devToolsConfig$jscomp$inline_1074 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-canary-51ffd3564-20231025",
|
||||
version: "18.3.0-canary-a9985529f-20231025",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1266 = {
|
||||
@@ -9482,7 +9482,7 @@ var internals$jscomp$inline_1266 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-canary-51ffd3564-20231025"
|
||||
reconcilerVersion: "18.3.0-canary-a9985529f-20231025"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1267 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-canary-51ffd3564-20231025";
|
||||
var ReactVersion = "18.3.0-canary-a9985529f-20231025";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
+1
-1
@@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-canary-51ffd3564-20231025";
|
||||
exports.version = "18.3.0-canary-a9985529f-20231025";
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
51ffd3564f97b58737df395d30628a27fa71a39d
|
||||
a9985529f1aa55477f0feafe2398d36707cf6108
|
||||
|
||||
Reference in New Issue
Block a user