@@ -72,9 +72,20 @@ function getOwner() {
72
72
let specialPropKeyWarningShown ;
73
73
let didWarnAboutElementRef ;
74
74
let didWarnAboutOldJSXRuntime ;
75
+ let unknownOwnerDebugStack ;
76
+ let unknownOwnerDebugTask ;
75
77
76
78
if ( __DEV__ ) {
77
79
didWarnAboutElementRef = { } ;
80
+ const unknownOwnerElement = {
81
+ 'react-stack-bottom-frame' : ( ) => {
82
+ return ( function UnknownOwner ( ) {
83
+ return jsxDEV ( ( ) => null , { } , null ) ;
84
+ } ) ( ) ;
85
+ } ,
86
+ } [ 'react-stack-bottom-frame' ] ( ) ;
87
+ unknownOwnerDebugStack = unknownOwnerElement . _debugStack ;
88
+ unknownOwnerDebugTask = unknownOwnerElement . _debugTask ;
78
89
}
79
90
80
91
function hasValidRef ( config ) {
@@ -396,12 +407,12 @@ export function jsxProdSignatureRunningInDevWithDynamicChildren(
396
407
__DEV__ &&
397
408
( recentlyCreatedOwnerStacks ++ < ownerStackLimit
398
409
? Error ( 'react-stack-top-frame' )
399
- : null ) ,
410
+ : unknownOwnerDebugStack ) ,
400
411
// TODO: If task.run is not the bottleneck, reuse a placeholder task to indicate the deop.
401
412
__DEV__ &&
402
413
( recentlyCreatedDebugTasks ++ < debugTaskLimit
403
414
? createTask ( getTaskName ( type ) )
404
- : null ) ,
415
+ : unknownOwnerDebugTask ) ,
405
416
) ;
406
417
}
407
418
}
@@ -426,12 +437,12 @@ export function jsxProdSignatureRunningInDevWithStaticChildren(
426
437
__DEV__ &&
427
438
( recentlyCreatedOwnerStacks ++ < ownerStackLimit
428
439
? Error ( 'react-stack-top-frame' )
429
- : null ) ,
440
+ : unknownOwnerDebugStack ) ,
430
441
// TODO: If task.run is not the bottleneck, reuse a placeholder task to indicate the deop.
431
442
__DEV__ &&
432
443
( recentlyCreatedDebugTasks ++ < debugTaskLimit
433
444
? createTask ( getTaskName ( type ) )
434
- : null ) ,
445
+ : unknownOwnerDebugTask ) ,
435
446
) ;
436
447
}
437
448
}
@@ -456,12 +467,12 @@ export function jsxDEV(type, config, maybeKey, isStaticChildren, source, self) {
456
467
__DEV__ &&
457
468
( recentlyCreatedOwnerStacks ++ < ownerStackLimit
458
469
? Error ( 'react-stack-top-frame' )
459
- : null ) ,
470
+ : unknownOwnerDebugStack ) ,
460
471
// TODO: If task.run is not the bottleneck, reuse a placeholder task to indicate the deop.
461
472
__DEV__ &&
462
473
( recentlyCreatedDebugTasks ++ < debugTaskLimit
463
474
? createTask ( getTaskName ( type ) )
464
- : null ) ,
475
+ : unknownOwnerDebugTask ) ,
465
476
) ;
466
477
}
467
478
@@ -740,12 +751,12 @@ export function createElement(type, config, children) {
740
751
__DEV__ &&
741
752
( recentlyCreatedOwnerStacks ++ < ownerStackLimit
742
753
? Error ( 'react-stack-top-frame' )
743
- : null ) ,
754
+ : unknownOwnerDebugStack ) ,
744
755
// TODO: If task.run is not the bottleneck, reuse a placeholder task to indicate the deop.
745
756
__DEV__ &&
746
757
( recentlyCreatedDebugTasks ++ < debugTaskLimit
747
758
? createTask ( getTaskName ( type ) )
748
- : null ) ,
759
+ : unknownOwnerDebugTask ) ,
749
760
) ;
750
761
}
751
762
0 commit comments