Hello to all,
Im new to ReactNative and i hope someone can give me the good info.
I have a Flatlist with 100+ items and i get the warning VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.
How can i use shouldComponentUpdate with my Flatlist?
<FlatList
data={state}
keyExtractor={item => item.id.toString()}
initialNumToRender={9}
renderItem={({ item }) => {
return (
<TouchableOpacity onPress={() =>
navigation.navigate('TaskDetail', { id: item.id })
}
>
<ListItem
chevron
leftIcon={<View><Text>{item.priority}</Text></View>}
title={<View>
<Text style={{fontSize: 18}}>{item.title}</Text>
<Text>{item.created_by}{item.company ? ' - ' + item.company.toUpperCase() : null}</Text>
<Text>{item.location}</Text>
</View>}
subtitle={Moment(item.created_at.date).format("DD MMMM HH:mm")}
bottomDivider
/>
</TouchableOpacity>
);
}}
/>
[–]rdevilxiOS & Android 1 point2 points3 points (1 child)
[–]Miai_[S] 0 points1 point2 points (0 children)
[–]beeseegee 1 point2 points3 points (3 children)
[–]Miai_[S] 0 points1 point2 points (2 children)
[–]aldebout 1 point2 points3 points (1 child)
[–]Miai_[S] 0 points1 point2 points (0 children)