@@ -121,9 +121,13 @@ describe('ReactLegacyCompositeComponent', () => {
121
121
assertConsoleErrorDev ( [
122
122
'Child uses the legacy childContextTypes API which will soon be removed. ' +
123
123
'Use React.createContext() instead. (https://react.dev/link/legacy-context)\n' +
124
+ ( gate ( 'enableOwnerStacks' ) ? '' : ' in Child (at **)\n' ) +
124
125
' in Parent (at **)' ,
125
126
'Grandchild uses the legacy contextTypes API which will soon be removed. ' +
126
127
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
128
+ ( gate ( 'enableOwnerStacks' )
129
+ ? ''
130
+ : ' in Grandchild (at **)\n' + ' in Child (at **)\n' ) +
127
131
' in Parent (at **)' ,
128
132
] ) ;
129
133
expect ( findDOMNode ( component ) . innerHTML ) . toBe ( 'bar' ) ;
@@ -196,7 +200,10 @@ describe('ReactLegacyCompositeComponent', () => {
196
200
' in Parent (at **)' ,
197
201
'Child uses the legacy contextTypes API which will soon be removed. ' +
198
202
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
199
- ' in Child (at **)' ,
203
+ ' in Child (at **)' +
204
+ ( gate ( 'enableOwnerStacks' )
205
+ ? ''
206
+ : '\n in Middle (at **)' + '\n in Parent (at **)' ) ,
200
207
] ) ;
201
208
202
209
await act ( ( ) => {
@@ -261,9 +268,15 @@ describe('ReactLegacyCompositeComponent', () => {
261
268
assertConsoleErrorDev ( [
262
269
'Parent uses the legacy childContextTypes API which will soon be removed. ' +
263
270
'Use React.createContext() instead. (https://react.dev/link/legacy-context)\n' +
271
+ ( gate ( 'enableOwnerStacks' ) ? '' : ' in Parent (at **)\n' ) +
264
272
' in Wrapper (at **)' ,
265
273
'Child uses the legacy contextTypes API which will soon be removed. ' +
266
274
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
275
+ ( gate ( 'enableOwnerStacks' )
276
+ ? ''
277
+ : ' in Child (at **)\n' +
278
+ ' in div (at **)\n' +
279
+ ' in Parent (at **)\n' ) +
267
280
' in Wrapper (at **)' ,
268
281
] ) ;
269
282
@@ -348,12 +361,15 @@ describe('ReactLegacyCompositeComponent', () => {
348
361
' in Parent (at **)' ,
349
362
'Child uses the legacy childContextTypes API which will soon be removed. ' +
350
363
'Use React.createContext() instead. (https://react.dev/link/legacy-context)\n' +
364
+ ( gate ( 'enableOwnerStacks' ) ? '' : ' in Child (at **)\n' ) +
351
365
' in Parent (at **)' ,
352
366
'Child uses the legacy contextTypes API which will soon be removed. ' +
353
367
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
368
+ ( gate ( 'enableOwnerStacks' ) ? '' : ' in Child (at **)\n' ) +
354
369
' in Parent (at **)' ,
355
370
'Grandchild uses the legacy contextTypes API which will soon be removed. ' +
356
371
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
372
+ ( gate ( 'enableOwnerStacks' ) ? '' : ' in Grandchild (at **)\n' ) +
357
373
' in Child (at **)\n' +
358
374
' in Parent (at **)' ,
359
375
] ) ;
@@ -425,6 +441,7 @@ describe('ReactLegacyCompositeComponent', () => {
425
441
assertConsoleErrorDev ( [
426
442
'Child uses the legacy contextTypes API which will soon be removed. ' +
427
443
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
444
+ ( gate ( 'enableOwnerStacks' ) ? '' : ' in Child (at **)\n' ) +
428
445
' in Parent (at **)' ,
429
446
] ) ;
430
447
0 commit comments