Push the async dispatcher if either feature is used for this flag

Basically always but we currently don't actually need it for prod on the
client.
This commit is contained in:
Sebastian Markbage
2024-04-22 12:05:45 -04:00
committed by Rick Hanlon
parent 76cc7fe481
commit 84d0305f89
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -1875,7 +1875,7 @@ function popDispatcher(prevDispatcher: any) {
}
function pushAsyncDispatcher() {
if (enableCache) {
if (enableCache || __DEV__ || !disableStringRefs) {
const prevAsyncDispatcher = ReactSharedInternals.A;
ReactSharedInternals.A = DefaultAsyncDispatcher;
return prevAsyncDispatcher;
@@ -1885,7 +1885,7 @@ function pushAsyncDispatcher() {
}
function popAsyncDispatcher(prevAsyncDispatcher: any) {
if (enableCache) {
if (enableCache || __DEV__ || !disableStringRefs) {
ReactSharedInternals.A = prevAsyncDispatcher;
}
}
+2 -1
View File
@@ -144,6 +144,7 @@ import {
enableRenderableContext,
enableRefAsProp,
disableDefaultPropsExceptForClasses,
disableStringRefs,
} from 'shared/ReactFeatureFlags';
import assign from 'shared/assign';
@@ -3664,7 +3665,7 @@ export function performWork(request: Request): void {
const prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = HooksDispatcher;
let prevAsyncDispatcher = null;
if (enableCache) {
if (enableCache || __DEV__ || !disableStringRefs) {
prevAsyncDispatcher = ReactSharedInternals.A;
ReactSharedInternals.A = DefaultAsyncDispatcher;
}