I start working with react native 1 month ago. Now i start building a simple that fetch data from internet and show layout like image below.
What is the best way to get these results into a grid?
this is my simple code
render() {
<FlatList
data={newsData}
renderItem={
({item,index}) =>
index === 0 ? this._renderHighlightedVideo(item.node,index) :
index === 5 ? this._renderAdvertisment() :
index > 10 && (index+2) % 7 === 0 ? this._renderAdvertisment() : this._renderGridVideo(item.node, index)
}
keyExtractor={(item, index) => index}
/>
}
_renderHighlightedVideo(news, index) { }
_renderAdvertisment(){ }
_renderGridVideo(item.node, index){ }