@@ -62,17 +62,17 @@ describe('ReactIncrementalErrorHandling', () => {
62
62
}
63
63
}
64
64
65
- function ErrorMessage ( props ) {
65
+ function ErrorMessage ( { error } ) {
66
66
Scheduler . unstable_yieldValue ( 'ErrorMessage' ) ;
67
- return < span prop = { `Caught an error: ${ props . error . message } ` } /> ;
67
+ return < span prop = { `Caught an error: ${ error . message } ` } /> ;
68
68
}
69
69
70
- function Indirection ( props ) {
70
+ function Indirection ( { children } ) {
71
71
Scheduler . unstable_yieldValue ( 'Indirection' ) ;
72
- return props . children || null ;
72
+ return children || null ;
73
73
}
74
74
75
- function BadRender ( ) {
75
+ function BadRender ( { unused } ) {
76
76
Scheduler . unstable_yieldValue ( 'throw' ) ;
77
77
throw new Error ( 'oops!' ) ;
78
78
}
@@ -156,17 +156,17 @@ describe('ReactIncrementalErrorHandling', () => {
156
156
}
157
157
}
158
158
159
- function ErrorMessage ( props ) {
159
+ function ErrorMessage ( { error } ) {
160
160
Scheduler . unstable_yieldValue ( 'ErrorMessage' ) ;
161
- return < span prop = { `Caught an error: ${ props . error . message } ` } /> ;
161
+ return < span prop = { `Caught an error: ${ error . message } ` } /> ;
162
162
}
163
163
164
- function Indirection ( props ) {
164
+ function Indirection ( { children } ) {
165
165
Scheduler . unstable_yieldValue ( 'Indirection' ) ;
166
- return props . children || null ;
166
+ return children || null ;
167
167
}
168
168
169
- function BadRender ( ) {
169
+ function BadRender ( { unused } ) {
170
170
Scheduler . unstable_yieldValue ( 'throw' ) ;
171
171
throw new Error ( 'oops!' ) ;
172
172
}
@@ -346,17 +346,17 @@ describe('ReactIncrementalErrorHandling', () => {
346
346
} ) ;
347
347
348
348
it ( 'retries one more time before handling error' , ( ) => {
349
- function BadRender ( ) {
349
+ function BadRender ( { unused } ) {
350
350
Scheduler . unstable_yieldValue ( 'BadRender' ) ;
351
351
throw new Error ( 'oops' ) ;
352
352
}
353
353
354
- function Sibling ( ) {
354
+ function Sibling ( { unused } ) {
355
355
Scheduler . unstable_yieldValue ( 'Sibling' ) ;
356
356
return < span prop = "Sibling" /> ;
357
357
}
358
358
359
- function Parent ( ) {
359
+ function Parent ( { unused } ) {
360
360
Scheduler . unstable_yieldValue ( 'Parent' ) ;
361
361
return (
362
362
< >
@@ -386,7 +386,7 @@ describe('ReactIncrementalErrorHandling', () => {
386
386
} ) ;
387
387
388
388
it ( 'retries one more time if an error occurs during a render that expires midway through the tree' , ( ) => {
389
- function Oops ( ) {
389
+ function Oops ( { unused } ) {
390
390
Scheduler . unstable_yieldValue ( 'Oops' ) ;
391
391
throw new Error ( 'Oops' ) ;
392
392
}
@@ -396,7 +396,7 @@ describe('ReactIncrementalErrorHandling', () => {
396
396
return text ;
397
397
}
398
398
399
- function App ( ) {
399
+ function App ( { unused } ) {
400
400
return (
401
401
< >
402
402
< Text text = "A" />
@@ -530,7 +530,7 @@ describe('ReactIncrementalErrorHandling', () => {
530
530
}
531
531
}
532
532
533
- function BrokenRender ( props ) {
533
+ function BrokenRender ( { unused } ) {
534
534
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
535
535
throw new Error ( 'Hello' ) ;
536
536
}
@@ -576,7 +576,7 @@ describe('ReactIncrementalErrorHandling', () => {
576
576
}
577
577
}
578
578
579
- function BrokenRender ( props ) {
579
+ function BrokenRender ( { unused } ) {
580
580
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
581
581
throw new Error ( 'Hello' ) ;
582
582
}
@@ -623,7 +623,7 @@ describe('ReactIncrementalErrorHandling', () => {
623
623
}
624
624
}
625
625
626
- function BrokenRender ( props ) {
626
+ function BrokenRender ( { unused } ) {
627
627
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
628
628
throw new Error ( 'Hello' ) ;
629
629
}
@@ -664,7 +664,7 @@ describe('ReactIncrementalErrorHandling', () => {
664
664
}
665
665
}
666
666
667
- function BrokenRender ( ) {
667
+ function BrokenRender ( { unused } ) {
668
668
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
669
669
throw new Error ( 'Hello' ) ;
670
670
}
@@ -703,7 +703,7 @@ describe('ReactIncrementalErrorHandling', () => {
703
703
}
704
704
}
705
705
706
- function BrokenRender ( ) {
706
+ function BrokenRender ( { unused } ) {
707
707
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
708
708
throw new Error ( 'Hello' ) ;
709
709
}
@@ -744,7 +744,7 @@ describe('ReactIncrementalErrorHandling', () => {
744
744
}
745
745
}
746
746
747
- function BrokenRender ( ) {
747
+ function BrokenRender ( { unused } ) {
748
748
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
749
749
throw new Error ( 'Hello' ) ;
750
750
}
@@ -784,7 +784,7 @@ describe('ReactIncrementalErrorHandling', () => {
784
784
}
785
785
}
786
786
787
- function BrokenRender ( ) {
787
+ function BrokenRender ( { unused } ) {
788
788
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
789
789
throw new Error ( 'Hello' ) ;
790
790
}
@@ -862,12 +862,12 @@ describe('ReactIncrementalErrorHandling', () => {
862
862
} ) ;
863
863
864
864
it ( 'can schedule updates after uncaught error in render on mount' , ( ) => {
865
- function BrokenRender ( ) {
865
+ function BrokenRender ( { unused } ) {
866
866
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
867
867
throw new Error ( 'Hello' ) ;
868
868
}
869
869
870
- function Foo ( ) {
870
+ function Foo ( { unused } ) {
871
871
Scheduler . unstable_yieldValue ( 'Foo' ) ;
872
872
return null ;
873
873
}
@@ -887,24 +887,24 @@ describe('ReactIncrementalErrorHandling', () => {
887
887
} ) ;
888
888
889
889
it ( 'can schedule updates after uncaught error in render on update' , ( ) => {
890
- function BrokenRender ( props ) {
890
+ function BrokenRender ( { shouldThrow } ) {
891
891
Scheduler . unstable_yieldValue ( 'BrokenRender' ) ;
892
- if ( props . throw ) {
892
+ if ( shouldThrow ) {
893
893
throw new Error ( 'Hello' ) ;
894
894
}
895
895
return null ;
896
896
}
897
897
898
- function Foo ( ) {
898
+ function Foo ( { unused } ) {
899
899
Scheduler . unstable_yieldValue ( 'Foo' ) ;
900
900
return null ;
901
901
}
902
902
903
- ReactNoop . render ( < BrokenRender throw = { false } /> ) ;
903
+ ReactNoop . render ( < BrokenRender shouldThrow = { false } /> ) ;
904
904
expect ( Scheduler ) . toFlushAndYield ( [ 'BrokenRender' ] ) ;
905
905
906
906
expect ( ( ) => {
907
- ReactNoop . render ( < BrokenRender throw = { true } /> ) ;
907
+ ReactNoop . render ( < BrokenRender shouldThrow = { true } /> ) ;
908
908
expect ( Scheduler ) . toFlushWithoutYielding ( ) ;
909
909
} ) . toThrow ( 'Hello' ) ;
910
910
expect ( Scheduler ) . toHaveYielded ( [
@@ -1454,13 +1454,13 @@ describe('ReactIncrementalErrorHandling', () => {
1454
1454
}
1455
1455
}
1456
1456
1457
- function Indirection ( props ) {
1457
+ function Indirection ( { children } ) {
1458
1458
Scheduler . unstable_yieldValue ( 'Indirection' ) ;
1459
- return props . children ;
1459
+ return children ;
1460
1460
}
1461
1461
1462
1462
const notAnError = { nonStandardMessage : 'oops' } ;
1463
- function BadRender ( ) {
1463
+ function BadRender ( { unused } ) {
1464
1464
Scheduler . unstable_yieldValue ( 'BadRender' ) ;
1465
1465
throw notAnError ;
1466
1466
}
@@ -1519,17 +1519,17 @@ describe('ReactIncrementalErrorHandling', () => {
1519
1519
}
1520
1520
}
1521
1521
1522
- function ErrorMessage ( props ) {
1522
+ function ErrorMessage ( { error } ) {
1523
1523
Scheduler . unstable_yieldValue ( 'ErrorMessage' ) ;
1524
- return < span prop = { `Caught an error: ${ props . error . message } ` } /> ;
1524
+ return < span prop = { `Caught an error: ${ error . message } ` } /> ;
1525
1525
}
1526
1526
1527
- function BadRenderSibling ( props ) {
1527
+ function BadRenderSibling ( { unused } ) {
1528
1528
Scheduler . unstable_yieldValue ( 'BadRenderSibling' ) ;
1529
1529
return null ;
1530
1530
}
1531
1531
1532
- function BadRender ( ) {
1532
+ function BadRender ( { unused } ) {
1533
1533
Scheduler . unstable_yieldValue ( 'throw' ) ;
1534
1534
throw new Error ( 'oops!' ) ;
1535
1535
}
@@ -1567,7 +1567,7 @@ describe('ReactIncrementalErrorHandling', () => {
1567
1567
// This test seems a bit contrived, but it's based on an actual regression
1568
1568
// where we checked for the existence of didUpdate instead of didMount, and
1569
1569
// didMount was not defined.
1570
- function BadRender ( ) {
1570
+ function BadRender ( { unused } ) {
1571
1571
Scheduler . unstable_yieldValue ( 'throw' ) ;
1572
1572
throw new Error ( 'oops!' ) ;
1573
1573
}
@@ -1711,7 +1711,7 @@ describe('ReactIncrementalErrorHandling', () => {
1711
1711
it ( 'uncaught errors should be discarded if the render is aborted' , async ( ) => {
1712
1712
const root = ReactNoop . createRoot ( ) ;
1713
1713
1714
- function Oops ( ) {
1714
+ function Oops ( { unused } ) {
1715
1715
Scheduler . unstable_yieldValue ( 'Oops' ) ;
1716
1716
throw Error ( 'Oops' ) ;
1717
1717
}
0 commit comments