@@ -14,7 +14,6 @@ import {
14
14
IsThisRendererActing ,
15
15
} from 'react-reconciler/inline.test' ;
16
16
import ReactSharedInternals from 'shared/ReactSharedInternals' ;
17
- import warning from 'shared/warning' ;
18
17
import enqueueTask from 'shared/enqueueTask' ;
19
18
import * as Scheduler from 'scheduler' ;
20
19
@@ -61,6 +60,7 @@ function act(callback: () => Thenable) {
61
60
if ( ! __DEV__ ) {
62
61
if ( didWarnAboutUsingActInProd === false ) {
63
62
didWarnAboutUsingActInProd = true ;
63
+ // eslint-disable-next-line react-internal/no-production-logging
64
64
console . error (
65
65
'act(...) is not supported in production builds of React, and might not behave as expected.' ,
66
66
) ;
@@ -83,7 +83,7 @@ function act(callback: () => Thenable) {
83
83
if ( __DEV__ ) {
84
84
if ( actingUpdatesScopeDepth > previousActingUpdatesScopeDepth ) {
85
85
// if it's _less than_ previousActingUpdatesScopeDepth, then we can assume the 'other' one has warned
86
- warning (
86
+ console . error (
87
87
'You seem to have overlapping act() calls, this is not supported. ' +
88
88
'Be sure to await previous act() calls before making a new one. ' ,
89
89
) ;
@@ -115,7 +115,7 @@ function act(callback: () => Thenable) {
115
115
. then ( ( ) => { } )
116
116
. then ( ( ) => {
117
117
if ( called === false ) {
118
- warning (
118
+ console . error (
119
119
'You called act(async () => ...) without await. ' +
120
120
'This could lead to unexpected testing behaviour, interleaving multiple act ' +
121
121
'calls and mixing their scopes. You should - await act(async () => ...);' ,
@@ -163,7 +163,7 @@ function act(callback: () => Thenable) {
163
163
} else {
164
164
if ( __DEV__ ) {
165
165
if ( result !== undefined ) {
166
- warning (
166
+ console . error (
167
167
'The callback passed to act(...) function ' +
168
168
'must return undefined, or a Promise. You returned %s' ,
169
169
result ,
@@ -191,7 +191,7 @@ function act(callback: () => Thenable) {
191
191
return {
192
192
then ( resolve : ( ) => void ) {
193
193
if ( __DEV__ ) {
194
- warning (
194
+ console . error (
195
195
'Do not await the result of calling act(...) with sync logic, it is not a Promise.' ,
196
196
) ;
197
197
}
0 commit comments