@@ -704,39 +704,17 @@ describe('ReactDOMFizzServer', () => {
704
704
705
705
it ( 'should client render a boundary if a lazy component rejects' , async ( ) => {
706
706
let rejectComponent ;
707
- const promise = new Promise ( ( resolve , reject ) => {
708
- rejectComponent = reject ;
709
- } ) ;
710
707
const LazyComponent = React . lazy ( ( ) => {
711
- return promise ;
712
- } ) ;
713
-
714
- const LazyLazy = React . lazy ( async ( ) => {
715
- return {
716
- default : LazyComponent ,
717
- } ;
718
- } ) ;
719
-
720
- function Wrapper ( { children} ) {
721
- return children ;
722
- }
723
- const LazyWrapper = React . lazy ( ( ) => {
724
- return {
725
- then ( callback ) {
726
- callback ( {
727
- default : Wrapper ,
728
- } ) ;
729
- } ,
730
- } ;
708
+ return new Promise ( ( resolve , reject ) => {
709
+ rejectComponent = reject ;
710
+ } ) ;
731
711
} ) ;
732
712
733
713
function App ( { isClient} ) {
734
714
return (
735
715
< div >
736
716
< Suspense fallback = { < Text text = "Loading..." /> } >
737
- < LazyWrapper >
738
- { isClient ? < Text text = "Hello" /> : < LazyLazy text = "Hello" /> }
739
- </ LazyWrapper >
717
+ { isClient ? < Text text = "Hello" /> : < LazyComponent text = "Hello" /> }
740
718
</ Suspense >
741
719
</ div >
742
720
) ;
@@ -770,7 +748,6 @@ describe('ReactDOMFizzServer', () => {
770
748
} ) ;
771
749
pipe ( writable ) ;
772
750
} ) ;
773
-
774
751
expect ( loggedErrors ) . toEqual ( [ ] ) ;
775
752
expect ( bootstrapped ) . toBe ( true ) ;
776
753
@@ -799,7 +776,7 @@ describe('ReactDOMFizzServer', () => {
799
776
'Switched to client rendering because the server rendering errored:\n\n' +
800
777
theError . message ,
801
778
expectedDigest ,
802
- componentStack ( [ 'Lazy' , 'Wrapper' , ' Suspense', 'div' , 'App' ] ) ,
779
+ componentStack ( [ 'Lazy' , 'Suspense' , 'div' , 'App' ] ) ,
803
780
] ,
804
781
] ,
805
782
[
@@ -879,9 +856,13 @@ describe('ReactDOMFizzServer', () => {
879
856
}
880
857
881
858
await act ( ( ) => {
882
- const { pipe} = renderToPipeableStream ( < App isClient = { false } /> , {
883
- onError,
884
- } ) ;
859
+ const { pipe} = renderToPipeableStream (
860
+ < App isClient = { false } /> ,
861
+
862
+ {
863
+ onError,
864
+ } ,
865
+ ) ;
885
866
pipe ( writable ) ;
886
867
} ) ;
887
868
expect ( loggedErrors ) . toEqual ( [ ] ) ;
@@ -919,7 +900,7 @@ describe('ReactDOMFizzServer', () => {
919
900
'Switched to client rendering because the server rendering errored:\n\n' +
920
901
theError . message ,
921
902
expectedDigest ,
922
- componentStack ( [ 'Suspense' , 'div' , 'App' ] ) ,
903
+ componentStack ( [ 'Lazy' , ' Suspense', 'div' , 'App' ] ) ,
923
904
] ,
924
905
] ,
925
906
[
@@ -1418,13 +1399,13 @@ describe('ReactDOMFizzServer', () => {
1418
1399
'The render was aborted by the server without a reason.' ,
1419
1400
expectedDigest ,
1420
1401
// We get the stack of the task when it was aborted which is why we see `h1`
1421
- componentStack ( [ 'AsyncText' , ' h1', 'Suspense' , 'div' , 'App' ] ) ,
1402
+ componentStack ( [ 'h1' , 'Suspense' , 'div' , 'App' ] ) ,
1422
1403
] ,
1423
1404
[
1424
1405
'Switched to client rendering because the server rendering aborted due to:\n\n' +
1425
1406
'The render was aborted by the server without a reason.' ,
1426
1407
expectedDigest ,
1427
- componentStack ( [ 'AsyncText' , ' Suspense', 'main' , 'div' , 'App' ] ) ,
1408
+ componentStack ( [ 'Suspense' , 'main' , 'div' , 'App' ] ) ,
1428
1409
] ,
1429
1410
] ,
1430
1411
[
@@ -3526,13 +3507,13 @@ describe('ReactDOMFizzServer', () => {
3526
3507
'Switched to client rendering because the server rendering aborted due to:\n\n' +
3527
3508
'foobar' ,
3528
3509
'a digest' ,
3529
- componentStack ( [ 'AsyncText' , ' Suspense', 'p' , 'div' , 'App' ] ) ,
3510
+ componentStack ( [ 'Suspense' , 'p' , 'div' , 'App' ] ) ,
3530
3511
] ,
3531
3512
[
3532
3513
'Switched to client rendering because the server rendering aborted due to:\n\n' +
3533
3514
'foobar' ,
3534
3515
'a digest' ,
3535
- componentStack ( [ 'AsyncText' , ' Suspense', 'span' , 'div' , 'App' ] ) ,
3516
+ componentStack ( [ 'Suspense' , 'span' , 'div' , 'App' ] ) ,
3536
3517
] ,
3537
3518
] ,
3538
3519
[
@@ -3609,13 +3590,13 @@ describe('ReactDOMFizzServer', () => {
3609
3590
'Switched to client rendering because the server rendering aborted due to:\n\n' +
3610
3591
'uh oh' ,
3611
3592
'a digest' ,
3612
- componentStack ( [ 'AsyncText' , ' Suspense', 'p' , 'div' , 'App' ] ) ,
3593
+ componentStack ( [ 'Suspense' , 'p' , 'div' , 'App' ] ) ,
3613
3594
] ,
3614
3595
[
3615
3596
'Switched to client rendering because the server rendering aborted due to:\n\n' +
3616
3597
'uh oh' ,
3617
3598
'a digest' ,
3618
- componentStack ( [ 'AsyncText' , ' Suspense', 'span' , 'div' , 'App' ] ) ,
3599
+ componentStack ( [ 'Suspense' , 'span' , 'div' , 'App' ] ) ,
3619
3600
] ,
3620
3601
] ,
3621
3602
[
0 commit comments