Two fixes to react-key generation (#2004)
* Fix missing react keys in ListMembers * Fix react key construction for the posts feedzio/stable
parent
1dc017367e
commit
cd43adf698
|
@ -19,8 +19,9 @@ export class FeedViewPostsSlice {
|
|||
constructor(public items: FeedViewPost[] = []) {}
|
||||
|
||||
get _reactKey() {
|
||||
return `slice-${this.items[0].post.uri}-${
|
||||
this.items[0].reason?.indexedAt || this.items[0].post.indexedAt
|
||||
const rootItem = this.isFlattenedReply ? this.items[1] : this.items[0]
|
||||
return `slice-${rootItem.post.uri}-${
|
||||
rootItem.reason?.indexedAt || rootItem.post.indexedAt
|
||||
}`
|
||||
}
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ export function ListMembers({
|
|||
testID={testID ? `${testID}-flatlist` : undefined}
|
||||
ref={scrollElRef}
|
||||
data={items}
|
||||
keyExtractor={(item: any) => item.uri || item._reactKey}
|
||||
keyExtractor={(item: any) => item.subject?.did || item._reactKey}
|
||||
renderItem={renderItem}
|
||||
ListHeaderComponent={renderHeader}
|
||||
ListFooterComponent={Footer}
|
||||
|
|
Loading…
Reference in New Issue