11// @flow
22
3- import React , { Suspense , useState } from 'react' ;
3+ import React , { Fragment , Suspense , useState } from 'react' ;
44
55function SuspenseTree ( ) {
66 return (
7- < >
7+ < Fragment >
88 < h1 > Suspense</ h1 >
99 < h4 > Primary to Fallback Cycle</ h4 >
1010 < PrimaryFallbackTest initialSuspend = { false } />
1111 < h4 > Fallback to Primary Cycle</ h4 >
1212 < PrimaryFallbackTest initialSuspend = { true } />
1313 < NestedSuspenseTest />
14- </ >
14+ </ Fragment >
1515 ) ;
1616}
1717
@@ -20,7 +20,7 @@ function PrimaryFallbackTest({ initialSuspend }) {
2020 const fallbackStep = useTestSequence ( 'fallback' , Fallback1 , Fallback2 ) ;
2121 const primaryStep = useTestSequence ( 'primary' , Primary1 , Primary2 ) ;
2222 return (
23- < >
23+ < Fragment >
2424 < label >
2525 < input
2626 checked = { suspend }
@@ -33,7 +33,7 @@ function PrimaryFallbackTest({ initialSuspend }) {
3333 < Suspense fallback = { fallbackStep } >
3434 { suspend ? < Never /> : primaryStep }
3535 </ Suspense >
36- </ >
36+ </ Fragment >
3737 ) ;
3838}
3939
@@ -45,32 +45,32 @@ function useTestSequence(label, T1, T2) {
4545 </ button >
4646 ) ;
4747 let allSteps = [
48- < > { next } </ > ,
49- < >
48+ < Fragment > { next } </ Fragment > ,
49+ < Fragment >
5050 { next } < T1 prop = { step } > mount</ T1 >
51- </ > ,
52- < >
51+ </ Fragment > ,
52+ < Fragment >
5353 { next } < T1 prop = { step } > update</ T1 >
54- </ > ,
55- < >
54+ </ Fragment > ,
55+ < Fragment >
5656 { next } < T2 prop = { step } > several</ T2 > < T1 prop = { step } > different</ T1 > { ' ' }
5757 < T2 prop = { step } > children</ T2 >
58- </ > ,
59- < >
58+ </ Fragment > ,
59+ < Fragment >
6060 { next } < T2 prop = { step } > goodbye</ T2 >
61- </ > ,
61+ </ Fragment > ,
6262 ] ;
6363 return allSteps [ step ] ;
6464}
6565
6666function NestedSuspenseTest ( ) {
6767 return (
68- < >
68+ < Fragment >
6969 < h3 > Nested Suspense</ h3 >
7070 < Suspense fallback = { < Fallback1 > Loading outer</ Fallback1 > } >
7171 < Parent />
7272 </ Suspense >
73- </ >
73+ </ Fragment >
7474 ) ;
7575}
7676
@@ -118,19 +118,19 @@ function Never() {
118118 throw new Promise ( resolve => { } ) ;
119119}
120120
121- function Fallback1 ( { prop, ...rest } ) {
121+ function Fallback1 ( { prop, ...rest } : any ) {
122122 return < span { ...rest } /> ;
123123}
124124
125- function Fallback2 ( { prop, ...rest } ) {
125+ function Fallback2 ( { prop, ...rest } : any ) {
126126 return < span { ...rest } /> ;
127127}
128128
129- function Primary1 ( { prop, ...rest } ) {
129+ function Primary1 ( { prop, ...rest } : any ) {
130130 return < span { ...rest } /> ;
131131}
132132
133- function Primary2 ( { prop, ...rest } ) {
133+ function Primary2 ( { prop, ...rest } : any ) {
134134 return < span { ...rest } /> ;
135135}
136136
0 commit comments