mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
committed by
Rick Hanlon
parent
76cc7fe481
commit
84d0305f89
+2
-2
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user