File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -3737,7 +3737,6 @@ function shouldForceFlushFallbacksInDEV() {
3737
3737
}
3738
3738
3739
3739
const flushMockScheduler = Scheduler . unstable_flushAllWithoutAsserting ;
3740
- const isSchedulerMocked = typeof flushMockScheduler === 'function' ;
3741
3740
3742
3741
// Returns whether additional work was scheduled. Caller should keep flushing
3743
3742
// until there's no work left.
@@ -3867,11 +3866,7 @@ export function act(callback: () => Thenable<mixed>): Thenable<void> {
3867
3866
called = true ;
3868
3867
result . then (
3869
3868
( ) => {
3870
- if (
3871
- actingUpdatesScopeDepth > 1 ||
3872
- ( isSchedulerMocked === true &&
3873
- previousIsSomeRendererActing === true )
3874
- ) {
3869
+ if ( actingUpdatesScopeDepth > 1 ) {
3875
3870
onDone ( ) ;
3876
3871
resolve ( ) ;
3877
3872
return ;
@@ -3907,10 +3902,7 @@ export function act(callback: () => Thenable<mixed>): Thenable<void> {
3907
3902
3908
3903
// flush effects until none remain, and cleanup
3909
3904
try {
3910
- if (
3911
- actingUpdatesScopeDepth === 1 &&
3912
- ( isSchedulerMocked === false || previousIsSomeRendererActing === false )
3913
- ) {
3905
+ if ( actingUpdatesScopeDepth === 1 ) {
3914
3906
// we're about to exit the act() scope,
3915
3907
// now's the time to flush effects
3916
3908
flushActWork ( ) ;
Original file line number Diff line number Diff line change @@ -3593,7 +3593,6 @@ function shouldForceFlushFallbacksInDEV() {
3593
3593
}
3594
3594
3595
3595
const flushMockScheduler = Scheduler . unstable_flushAllWithoutAsserting ;
3596
- const isSchedulerMocked = typeof flushMockScheduler === 'function' ;
3597
3596
3598
3597
// Returns whether additional work was scheduled. Caller should keep flushing
3599
3598
// until there's no work left.
@@ -3723,11 +3722,7 @@ export function act(callback: () => Thenable<mixed>): Thenable<void> {
3723
3722
called = true ;
3724
3723
result . then (
3725
3724
( ) => {
3726
- if (
3727
- actingUpdatesScopeDepth > 1 ||
3728
- ( isSchedulerMocked === true &&
3729
- previousIsSomeRendererActing === true )
3730
- ) {
3725
+ if ( actingUpdatesScopeDepth > 1 ) {
3731
3726
onDone ( ) ;
3732
3727
resolve ( ) ;
3733
3728
return ;
@@ -3763,10 +3758,7 @@ export function act(callback: () => Thenable<mixed>): Thenable<void> {
3763
3758
3764
3759
// flush effects until none remain, and cleanup
3765
3760
try {
3766
- if (
3767
- actingUpdatesScopeDepth === 1 &&
3768
- ( isSchedulerMocked === false || previousIsSomeRendererActing === false )
3769
- ) {
3761
+ if ( actingUpdatesScopeDepth === 1 ) {
3770
3762
// we're about to exit the act() scope,
3771
3763
// now's the time to flush effects
3772
3764
flushActWork ( ) ;
You can’t perform that action at this time.
0 commit comments