Skip to content

Commit 9a6b963

Browse files
committed
fix: message list sub components props
1 parent 72a2102 commit 9a6b963

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

package/src/components/MessageList/MessageList.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,23 +1143,14 @@ const MessageListWithContext = (props: MessageListPropsWithContext) => {
11431143
}
11441144
}
11451145

1146-
const ItemSeparatorComponent = additionalFlatListProps?.ItemSeparatorComponent;
1147-
const WrappedItemSeparatorComponent = useCallback(() => {
1148-
return ItemSeparatorComponent ? <ItemSeparatorComponent /> : null;
1149-
}, [ItemSeparatorComponent]);
1150-
11511146
// We need to omit the style related props from the additionalFlatListProps and add them directly instead of spreading
11521147
let additionalFlatListPropsExcludingStyle:
1153-
| Omit<
1154-
NonNullable<typeof additionalFlatListProps>,
1155-
'style' | 'contentContainerStyle' | 'ItemSeparatorComponent'
1156-
>
1148+
| Omit<NonNullable<typeof additionalFlatListProps>, 'style' | 'contentContainerStyle'>
11571149
| undefined;
11581150

11591151
if (additionalFlatListProps) {
11601152
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1161-
const { contentContainerStyle, ItemSeparatorComponent, style, ...rest } =
1162-
additionalFlatListProps;
1153+
const { contentContainerStyle, style, ...rest } = additionalFlatListProps;
11631154
additionalFlatListPropsExcludingStyle = rest;
11641155
}
11651156

@@ -1206,7 +1197,6 @@ const MessageListWithContext = (props: MessageListPropsWithContext) => {
12061197
data={processedMessageList}
12071198
extraData={disabled}
12081199
inverted={inverted}
1209-
ItemSeparatorComponent={WrappedItemSeparatorComponent}
12101200
keyboardShouldPersistTaps='handled'
12111201
keyExtractor={keyExtractor}
12121202
ListFooterComponent={FooterComponent}

package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ exports[`Thread should match thread snapshot 1`] = `
3434
testID="message-flat-list-wrapper"
3535
>
3636
<RCTScrollView
37-
ItemSeparatorComponent={[Function]}
3837
ListFooterComponent={null}
3938
ListHeaderComponent={[Function]}
4039
contentContainerStyle={

0 commit comments

Comments
 (0)