Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29438

ScrollToEnd works once in a flatListItems [closed]

$
0
0

I have a list of items that each item has an image album in a horizontal FlatList

<FlatList
    ref={it => {
        carousel = it;
    }}
    onContentSizeChange={()=> this.carousel.scrollToEnd()}
    scrollEnabled
    data={images}
    horizontal
    renderItem={({ item, index }) => renderRow(item, index)}
    keyExtractor={item => item.title}
    onEndReachedThreshold={0.7}/>

I want each item to scrollToEnd

const scrollToEnd = () => carousel.scrollToEnd({ animated: false });

But scrollToEnd works only on the last item in the list and all other items are in first image of album

What should I do?


Viewing all articles
Browse latest Browse all 29438

Trending Articles