Quantcast
Channel: React FlatList renderItem - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Luis-Carlos for React FlatList renderItem

$
0
0

adding to what @Balasubramanian stated, the renderItem points to the current item and since you are using a List component as a wrapper then you can also use the 'ListItem' component inside the renderItem function to render the current item's data, like so:

renderItem={({ item, index }) => {
  return (
     <ListItem
        key={index}
        title={item.name}
        onPress={ () => this.assetSelected(item) }
      />
  );
}

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>