@@ -118,6 +118,7 @@ import {
118
118
} from './ReactUpdateQueue.new' ;
119
119
import { pushInterleavedQueue } from './ReactFiberInterleavedUpdates.new' ;
120
120
import { warnOnSubscriptionInsideStartTransition } from 'shared/ReactFeatureFlags' ;
121
+ import { isActEnvironment } from './ReactFiberAct.new' ;
121
122
122
123
const { ReactCurrentDispatcher, ReactCurrentBatchConfig} = ReactSharedInternals ;
123
124
@@ -1678,8 +1679,7 @@ function mountEffect(
1678
1679
deps : Array < mixed > | void | null,
1679
1680
): void {
1680
1681
if ( __DEV__ ) {
1681
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
1682
- if ( 'undefined' !== typeof jest ) {
1682
+ if ( isActEnvironment ( currentlyRenderingFiber ) ) {
1683
1683
warnIfNotCurrentlyActingEffectsInDEV ( currentlyRenderingFiber ) ;
1684
1684
}
1685
1685
}
@@ -1709,8 +1709,7 @@ function updateEffect(
1709
1709
deps : Array < mixed > | void | null,
1710
1710
): void {
1711
1711
if ( __DEV__ ) {
1712
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
1713
- if ( 'undefined' !== typeof jest ) {
1712
+ if ( isActEnvironment ( currentlyRenderingFiber ) ) {
1714
1713
warnIfNotCurrentlyActingEffectsInDEV ( currentlyRenderingFiber ) ;
1715
1714
}
1716
1715
}
@@ -2193,8 +2192,7 @@ function dispatchReducerAction<S, A>(
2193
2192
enqueueUpdate ( fiber , queue , update , lane ) ;
2194
2193
2195
2194
if ( __DEV__ ) {
2196
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
2197
- if ( 'undefined' !== typeof jest ) {
2195
+ if ( isActEnvironment ( fiber ) ) {
2198
2196
warnIfNotCurrentlyActingUpdatesInDev ( fiber ) ;
2199
2197
}
2200
2198
}
@@ -2279,8 +2277,7 @@ function dispatchSetState<S, A>(
2279
2277
}
2280
2278
}
2281
2279
if ( __DEV__ ) {
2282
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
2283
- if ( 'undefined' !== typeof jest ) {
2280
+ if ( isActEnvironment ( fiber ) ) {
2284
2281
warnIfNotCurrentlyActingUpdatesInDev ( fiber ) ;
2285
2282
}
2286
2283
}
0 commit comments