@@ -18,18 +18,9 @@ import {checkKeyStringCoercion} from 'shared/CheckStringCoercion';
18
18
import isArray from 'shared/isArray' ;
19
19
import {
20
20
disableDefaultPropsExceptForClasses ,
21
- debugInfoLimitsResetIntervalMs ,
22
- debugTaskLimit ,
23
21
ownerStackLimit ,
24
22
} from 'shared/ReactFeatureFlags' ;
25
23
26
- let recentlyCreatedOwnerStacks = 0 ;
27
- let recentlyCreatedDebugTasks = 0 ;
28
- setInterval ( ( ) => {
29
- recentlyCreatedOwnerStacks = 0 ;
30
- recentlyCreatedDebugTasks = 0 ;
31
- } , debugInfoLimitsResetIntervalMs ) ;
32
-
33
24
const createTask =
34
25
// eslint-disable-next-line react-internal/no-production-logging
35
26
__DEV__ && console . createTask
@@ -396,6 +387,8 @@ export function jsxProdSignatureRunningInDevWithDynamicChildren(
396
387
) {
397
388
if ( __DEV__ ) {
398
389
const isStaticChildren = false ;
390
+ const trackActualOwner =
391
+ ReactSharedInternals . recentlyCreatedOwnerStacks ++ < ownerStackLimit ;
399
392
return jsxDEVImpl (
400
393
type ,
401
394
config ,
@@ -404,11 +397,11 @@ export function jsxProdSignatureRunningInDevWithDynamicChildren(
404
397
source ,
405
398
self ,
406
399
__DEV__ &&
407
- ( recentlyCreatedOwnerStacks ++ < ownerStackLimit
400
+ ( trackActualOwner
408
401
? Error ( 'react-stack-top-frame' )
409
402
: unknownOwnerDebugStack ) ,
410
403
__DEV__ &&
411
- ( recentlyCreatedDebugTasks ++ < debugTaskLimit
404
+ ( trackActualOwner
412
405
? createTask ( getTaskName ( type ) )
413
406
: unknownOwnerDebugTask ) ,
414
407
) ;
@@ -424,6 +417,8 @@ export function jsxProdSignatureRunningInDevWithStaticChildren(
424
417
) {
425
418
if ( __DEV__ ) {
426
419
const isStaticChildren = true ;
420
+ const trackActualOwner =
421
+ ReactSharedInternals . recentlyCreatedOwnerStacks ++ < ownerStackLimit ;
427
422
return jsxDEVImpl (
428
423
type ,
429
424
config ,
@@ -432,11 +427,11 @@ export function jsxProdSignatureRunningInDevWithStaticChildren(
432
427
source ,
433
428
self ,
434
429
__DEV__ &&
435
- ( recentlyCreatedOwnerStacks ++ < ownerStackLimit
430
+ ( trackActualOwner
436
431
? Error ( 'react-stack-top-frame' )
437
432
: unknownOwnerDebugStack ) ,
438
433
__DEV__ &&
439
- ( recentlyCreatedDebugTasks ++ < debugTaskLimit
434
+ ( trackActualOwner
440
435
? createTask ( getTaskName ( type ) )
441
436
: unknownOwnerDebugTask ) ,
442
437
) ;
@@ -452,6 +447,8 @@ const didWarnAboutKeySpread = {};
452
447
* @param {string } key
453
448
*/
454
449
export function jsxDEV ( type , config , maybeKey , isStaticChildren , source , self ) {
450
+ const trackActualOwner =
451
+ ReactSharedInternals . recentlyCreatedOwnerStacks ++ < ownerStackLimit ;
455
452
return jsxDEVImpl (
456
453
type ,
457
454
config ,
@@ -460,11 +457,11 @@ export function jsxDEV(type, config, maybeKey, isStaticChildren, source, self) {
460
457
source ,
461
458
self ,
462
459
__DEV__ &&
463
- ( recentlyCreatedOwnerStacks ++ < ownerStackLimit
460
+ ( trackActualOwner
464
461
? Error ( 'react-stack-top-frame' )
465
462
: unknownOwnerDebugStack ) ,
466
463
__DEV__ &&
467
- ( recentlyCreatedDebugTasks ++ < debugTaskLimit
464
+ ( trackActualOwner
468
465
? createTask ( getTaskName ( type ) )
469
466
: unknownOwnerDebugTask ) ,
470
467
) ;
@@ -733,7 +730,8 @@ export function createElement(type, config, children) {
733
730
defineKeyPropWarningGetter ( props , displayName ) ;
734
731
}
735
732
}
736
-
733
+ const trackActualOwner =
734
+ ReactSharedInternals . recentlyCreatedOwnerStacks ++ < ownerStackLimit ;
737
735
return ReactElement (
738
736
type ,
739
737
key ,
@@ -742,11 +740,11 @@ export function createElement(type, config, children) {
742
740
getOwner ( ) ,
743
741
props ,
744
742
__DEV__ &&
745
- ( recentlyCreatedOwnerStacks ++ < ownerStackLimit
743
+ ( trackActualOwner
746
744
? Error ( 'react-stack-top-frame' )
747
745
: unknownOwnerDebugStack ) ,
748
746
__DEV__ &&
749
- ( recentlyCreatedDebugTasks ++ < debugTaskLimit
747
+ ( trackActualOwner
750
748
? createTask ( getTaskName ( type ) )
751
749
: unknownOwnerDebugTask ) ,
752
750
) ;
0 commit comments