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

React FlatList renderItem

$
0
0

I've seen this sort of syntax in JS before and I am just curious how it works. In the React Native Docs for FlatList, an example calls renderItem. How does this._renderItem know that what individual list item it is working with? It looks like item is being destructured, but from what object? Example from React Native Docs

Put differently: in Flatlist, another way to make this same call could be:

<FlatList <other props> renderItem={({item}) => (<MyListItem ....) />

Is renderItem some special prop where {item} will always be the destructured arg?


Viewing all articles
Browse latest Browse all 6

Trending Articles



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