xxxxxxxxxx
<VirtualizedList
// Use keyExtractor to help the list optimize performance
keyExtractor={item => item.id}
data={data}
initialNumToRender={7}
renderItem={({item})=> {
return <Text>{item.name}</Text>;
}}
// the virtualized list doesn't know how you want to extract your data
// you need to tell it
getItem={(data, index) => {
const dataIndex = data.allIds[index];
return data.byId[dataIndex];
}}
// it also needs to know how much data you have
getItemCount={data => data.allIds.length}
/>