@@ -24,7 +24,7 @@ if (__DEV__) {
24
24
) {
25
25
__REACT_DEVTOOLS_GLOBAL_HOOK__ . registerInternalModuleStart ( new Error ( ) ) ;
26
26
}
27
- var ReactVersion = "19.0.0-www-classic-8aa01ae9 " ;
27
+ var ReactVersion = "19.0.0-www-classic-b9e0eea7 " ;
28
28
29
29
// ATTENTION
30
30
// When adding new symbols to this file,
@@ -843,7 +843,7 @@ if (__DEV__) {
843
843
844
844
var ReactCurrentDispatcher = ReactSharedInternals . ReactCurrentDispatcher ;
845
845
var prefix ;
846
- function describeBuiltInComponentFrame ( name ) {
846
+ function describeBuiltInComponentFrame ( name , ownerFn ) {
847
847
{
848
848
if ( prefix === undefined ) {
849
849
// Extract the VM specific prefix used by each line.
@@ -1112,7 +1112,7 @@ if (__DEV__) {
1112
1112
1113
1113
return syntheticFrame ;
1114
1114
}
1115
- function describeFunctionComponentFrame ( fn ) {
1115
+ function describeFunctionComponentFrame ( fn , ownerFn ) {
1116
1116
{
1117
1117
return describeNativeComponentFrame ( fn , false ) ;
1118
1118
}
@@ -1123,7 +1123,7 @@ if (__DEV__) {
1123
1123
return ! ! ( prototype && prototype . isReactComponent ) ;
1124
1124
}
1125
1125
1126
- function describeUnknownElementTypeFrameInDEV ( type ) {
1126
+ function describeUnknownElementTypeFrameInDEV ( type , ownerFn ) {
1127
1127
if ( type == null ) {
1128
1128
return "" ;
1129
1129
}
@@ -1153,7 +1153,7 @@ if (__DEV__) {
1153
1153
1154
1154
case REACT_MEMO_TYPE :
1155
1155
// Memo may contain any component type so we recursively resolve it.
1156
- return describeUnknownElementTypeFrameInDEV ( type . type ) ;
1156
+ return describeUnknownElementTypeFrameInDEV ( type . type , ownerFn ) ;
1157
1157
1158
1158
case REACT_LAZY_TYPE : {
1159
1159
var lazyComponent = type ;
@@ -1162,7 +1162,10 @@ if (__DEV__) {
1162
1162
1163
1163
try {
1164
1164
// Lazy may contain any component type so we recursively resolve it.
1165
- return describeUnknownElementTypeFrameInDEV ( init ( payload ) ) ;
1165
+ return describeUnknownElementTypeFrameInDEV (
1166
+ init ( payload ) ,
1167
+ ownerFn
1168
+ ) ;
1166
1169
} catch ( x ) { }
1167
1170
}
1168
1171
}
@@ -2094,18 +2097,14 @@ if (__DEV__) {
2094
2097
2095
2098
if (
2096
2099
element &&
2097
- element . _owner != null &&
2100
+ element . _owner &&
2098
2101
element . _owner !== ReactCurrentOwner . current
2099
2102
) {
2100
- var ownerName = null ;
2101
-
2102
- if ( typeof element . _owner . tag === "number" ) {
2103
- ownerName = getComponentNameFromType ( element . _owner . type ) ;
2104
- } else if ( typeof element . _owner . name === "string" ) {
2105
- ownerName = element . _owner . name ;
2106
- } // Give the component that originally created this child.
2107
-
2108
- childOwner = " It was passed a child from " + ownerName + "." ;
2103
+ // Give the component that originally created this child.
2104
+ childOwner =
2105
+ " It was passed a child from " +
2106
+ getComponentNameFromType ( element . _owner . type ) +
2107
+ "." ;
2109
2108
}
2110
2109
2111
2110
setCurrentlyValidatingElement ( element ) ;
@@ -2124,7 +2123,11 @@ if (__DEV__) {
2124
2123
function setCurrentlyValidatingElement ( element ) {
2125
2124
{
2126
2125
if ( element ) {
2127
- var stack = describeUnknownElementTypeFrameInDEV ( element . type ) ;
2126
+ var owner = element . _owner ;
2127
+ var stack = describeUnknownElementTypeFrameInDEV (
2128
+ element . type ,
2129
+ owner ? owner . type : null
2130
+ ) ;
2128
2131
ReactDebugCurrentFrame . setExtraStackFrame ( stack ) ;
2129
2132
} else {
2130
2133
ReactDebugCurrentFrame . setExtraStackFrame ( null ) ;
0 commit comments