fix: GU-2766 add key prop in flash list

This commit is contained in:
gamingumar 2023-10-08 11:28:04 +05:00
parent ebd3278d6a
commit 1657f49091
3 changed files with 3 additions and 0 deletions

View File

@ -171,6 +171,7 @@ const CommentsView = ({
<FlashList
contentContainerStyle={{ padding: 0, ...styles.list, ...styleOerride, }}
data={comments}
keyExtractor={(item) => item.author + item.permlink}
renderItem={_renderItem}
ListEmptyComponent={_renderEmptyContent()}
ListHeaderComponent={postContentView}

View File

@ -313,6 +313,7 @@ const PostComments = forwardRef(
<FlashList
ref={commentsListRef}
style={styles.list}
keyExtractor={(item) => `${item.author}/${item.permlink}`}
contentContainerStyle={styles.listContent}
ListHeaderComponent={_postContentView}
ListEmptyComponent={_renderEmptyContent}

View File

@ -272,6 +272,7 @@ const postsListContainer = (
data={cacheInjectedData}
showsVerticalScrollIndicator={false}
renderItem={_renderItem}
keyExtractor={(content, index) => `${content.author}/${content.permlink}-${index}`}
onEndReachedThreshold={1}
maxToRenderPerBatch={5}
initialNumToRender={3}