File tree Expand file tree Collapse file tree 4 files changed +48
-56
lines changed
Expand file tree Collapse file tree 4 files changed +48
-56
lines changed Original file line number Diff line number Diff line change @@ -22,20 +22,18 @@ function InfiniteListWithHorizontalScroll() {
2222 } ) ;
2323
2424 return (
25- < >
26- < ListContainer ref = { rootRef } >
27- < List direction = "horizontal" >
28- { items . map ( ( item ) => (
29- < ListItem key = { item . key } > { item . value } </ ListItem >
30- ) ) }
31- { hasNextPage && (
32- < ListItem ref = { infiniteRef } >
33- < Loading />
34- </ ListItem >
35- ) }
36- </ List >
37- </ ListContainer >
38- </ >
25+ < ListContainer ref = { rootRef } >
26+ < List direction = "horizontal" >
27+ { items . map ( ( item ) => (
28+ < ListItem key = { item . key } > { item . value } </ ListItem >
29+ ) ) }
30+ { hasNextPage && (
31+ < ListItem ref = { infiniteRef } >
32+ < Loading />
33+ </ ListItem >
34+ ) }
35+ </ List >
36+ </ ListContainer >
3937 ) ;
4038}
4139
Original file line number Diff line number Diff line change @@ -53,20 +53,18 @@ function InfiniteListWithReverseHozirontalScroll() {
5353 } , [ ] ) ;
5454
5555 return (
56- < >
57- < ListContainer ref = { rootRefSetter } onScroll = { handleRootScroll } >
58- < List direction = "horizontal" >
59- { hasNextPage && (
60- < ListItem ref = { infiniteRef } >
61- < Loading />
62- </ ListItem >
63- ) }
64- { reversedItems . map ( ( item ) => (
65- < ListItem key = { item . key } > { item . value } </ ListItem >
66- ) ) }
67- </ List >
68- </ ListContainer >
69- </ >
56+ < ListContainer ref = { rootRefSetter } onScroll = { handleRootScroll } >
57+ < List direction = "horizontal" >
58+ { hasNextPage && (
59+ < ListItem ref = { infiniteRef } >
60+ < Loading />
61+ </ ListItem >
62+ ) }
63+ { reversedItems . map ( ( item ) => (
64+ < ListItem key = { item . key } > { item . value } </ ListItem >
65+ ) ) }
66+ </ List >
67+ </ ListContainer >
7068 ) ;
7169}
7270
Original file line number Diff line number Diff line change @@ -55,20 +55,18 @@ function InfiniteListWithReverseVerticalScroll() {
5555 } , [ ] ) ;
5656
5757 return (
58- < >
59- < ListContainer ref = { rootRefSetter } onScroll = { handleRootScroll } >
60- < List >
61- { hasNextPage && (
62- < ListItem ref = { infiniteRef } >
63- < Loading />
64- </ ListItem >
65- ) }
66- { reversedItems . map ( ( item ) => (
67- < ListItem key = { item . key } > { item . value } </ ListItem >
68- ) ) }
69- </ List >
70- </ ListContainer >
71- </ >
58+ < ListContainer ref = { rootRefSetter } onScroll = { handleRootScroll } >
59+ < List >
60+ { hasNextPage && (
61+ < ListItem ref = { infiniteRef } >
62+ < Loading />
63+ </ ListItem >
64+ ) }
65+ { reversedItems . map ( ( item ) => (
66+ < ListItem key = { item . key } > { item . value } </ ListItem >
67+ ) ) }
68+ </ List >
69+ </ ListContainer >
7270 ) ;
7371}
7472
Original file line number Diff line number Diff line change @@ -23,20 +23,18 @@ function InfiniteListWithVerticalScroll() {
2323 } ) ;
2424
2525 return (
26- < >
27- < ListContainer ref = { rootRef } >
28- < List >
29- { items . map ( ( item ) => (
30- < ListItem key = { item . key } > { item . value } </ ListItem >
31- ) ) }
32- { hasNextPage && (
33- < ListItem ref = { infiniteRef } >
34- < Loading />
35- </ ListItem >
36- ) }
37- </ List >
38- </ ListContainer >
39- </ >
26+ < ListContainer ref = { rootRef } >
27+ < List >
28+ { items . map ( ( item ) => (
29+ < ListItem key = { item . key } > { item . value } </ ListItem >
30+ ) ) }
31+ { hasNextPage && (
32+ < ListItem ref = { infiniteRef } >
33+ < Loading />
34+ </ ListItem >
35+ ) }
36+ </ List >
37+ </ ListContainer >
4038 ) ;
4139}
4240
You can’t perform that action at this time.
0 commit comments