Reputation: 847
I have a view that has top banner and some text, and after that there is a list of product which uses pagination, what I want to do is use flat list, Is there a way to configure it so that in my renderItems I'll return my products and have the the static content in same flat list?
Upvotes: 0
Views: 799
Reputation: 953
If you have fixed banner and some text before the flatlist. You can wrap the banner, text and flatlist in scrollView.This will work as you wanted.
render(){
return(
<ScrollView>
this.renderBanner();
this.renderText();
this.renderFlatList();
</ScrollView)
}
Upvotes: 0
Reputation: 2451
If your Banner and text will always be on top of product list then you can use ListHeaderComponent prop of Flatlist to render static content(e.g. banner and text).
<FlatList
...
ListHeaderComponent={this.renderHeader}
/>
Upvotes: 1