@@ -97,14 +97,16 @@ describe('VirtualizedSectionList', () => {
9797 ListEmptyComponent = { ( ) => < empty /> }
9898 ListFooterComponent = { ( ) => < footer /> }
9999 ListHeaderComponent = { ( ) => < header /> }
100- sections = { [
101- {
102- title : 's1' ,
103- data : new Array < void > ( 5 )
104- . fill ( )
105- . map ( ( _ , ii ) => ( { id : String ( ii ) } ) ) as Array < { id : string } > ,
106- } ,
107- ] }
100+ sections = {
101+ [
102+ {
103+ title : 's1' ,
104+ data : new Array < void > ( 5 )
105+ . fill ( )
106+ . map ( ( _ , ii ) => ( { id : String ( ii ) } ) ) as Array < { id : string } > ,
107+ } ,
108+ ] as Array < SectionBase < { id : string } > >
109+ }
108110 getItem = { ( data , key ) => data [ key ] }
109111 getItemCount={ data => data . length }
110112 getItemLayout={ ( { index} ) => ( {
@@ -165,21 +167,25 @@ describe('VirtualizedSectionList', () => {
165167 component = ReactTestRenderer . create (
166168 < VirtualizedSectionList
167169 // $FlowFixMe[incompatible-type]
168- sections = { [
169- { title : 'outer' , data : [ { key : 'outer0' } , { key : 'outer1' } ] } ,
170- ] }
170+ sections = {
171+ [
172+ { title : 'outer' , data : [ { key : 'outer0' } , { key : 'outer1' } ] } ,
173+ ] as Array < SectionBase < { key : string } > >
174+ }
171175 renderItem = { outerInfo => (
172176 < VirtualizedSectionList
173- sections = { [
174- // $FlowFixMe[incompatible-type]
175- {
176- title : 'inner' ,
177- data : [
178- { key : outerInfo . item . key + ':inner0' } ,
179- { key : outerInfo . item . key + ':inner1' } ,
180- ] ,
181- } ,
182- ] }
177+ sections = {
178+ [
179+ // $FlowFixMe[incompatible-type]
180+ {
181+ title : 'inner' ,
182+ data : [
183+ { key : outerInfo . item . key + ':inner0' } ,
184+ { key : outerInfo . item . key + ':inner1' } ,
185+ ] ,
186+ } ,
187+ ] as Array < SectionBase < { key : string } > >
188+ }
183189 horizontal = { outerInfo . item . key === 'outer1' }
184190 renderItem={ innerInfo => {
185191 return < item title = { innerInfo . item . key } /> ;
@@ -206,18 +212,20 @@ describe('VirtualizedSectionList', () => {
206212 await ReactTestRenderer . act ( ( ) => {
207213 component = ReactTestRenderer . create (
208214 < VirtualizedSectionList
209- sections = { [
210- // $FlowFixMe[incompatible-type]
211- {
212- title : 's1' ,
213- data : [ { key : 'i1.1' } , { key : 'i1.2' } , { key : 'i1.3' } ] ,
214- } ,
215- // $FlowFixMe[incompatible-type]
216- {
217- title : 's2' ,
218- data : [ { key : 'i2.1' } , { key : 'i2.2' } , { key : 'i2.3' } ] ,
219- } ,
220- ] }
215+ sections = {
216+ [
217+ // $FlowFixMe[incompatible-type]
218+ {
219+ title : 's1' ,
220+ data : [ { key : 'i1.1' } , { key : 'i1.2' } , { key : 'i1.3' } ] ,
221+ } ,
222+ // $FlowFixMe[incompatible-type]
223+ {
224+ title : 's2' ,
225+ data : [ { key : 'i2.1' } , { key : 'i2.2' } , { key : 'i2.3' } ] ,
226+ } ,
227+ ] as Array < SectionBase < { key : string } > >
228+ }
221229 renderItem = { ( { item} ) => < item value = { item . key } /> }
222230 getItem={ ( data , key ) => data [ key ] }
223231 getItemCount={ data => data . length }
0 commit comments