diff --git a/packages/uikit-react-native/src/components/ChannelMessageList/index.tsx b/packages/uikit-react-native/src/components/ChannelMessageList/index.tsx index 49989dd4a..9bcc8477e 100644 --- a/packages/uikit-react-native/src/components/ChannelMessageList/index.tsx +++ b/packages/uikit-react-native/src/components/ChannelMessageList/index.tsx @@ -90,6 +90,7 @@ export type ChannelMessageListProps void; newMessages: SendbirdMessage[] }) => React.ReactElement | null); renderScrollToBottomButton: null | ((props: { visible: boolean; onPress: () => void }) => React.ReactElement | null); + flatListComponent?: React.ComponentType>; flatListProps?: Omit, 'data' | 'renderItem'>; } & { ref?: Ref> | undefined; @@ -118,6 +119,7 @@ const ChannelMessageList = )} , 'onEndReached'> & { onBottomReached: () => void; onTopReached: () => void; onScrolledAwayFromBottom: (value: boolean) => void; + flatListComponent?: React.ComponentType>; }; const ChatFlatList = forwardRef(function ChatFlatList( - { onTopReached, onBottomReached, onScrolledAwayFromBottom, onScroll, ...props }, + { onTopReached, onBottomReached, onScrolledAwayFromBottom, onScroll, flatListComponent, ...props }, ref, ) { const { select } = useUIKitTheme(); @@ -60,8 +61,10 @@ const ChatFlatList = forwardRef(function ChatFlatList( ); } + const FlatList = flatListComponent ?? FlatListInternal; + return ( - ): G channel, keyboardAvoidOffset, sortComparator = messageComparator, + flatListComponent, flatListProps, messageListQueryParams, collectionCreator, @@ -267,6 +268,7 @@ const createGroupChannelFragment = (initModule?: Partial): G onResendFailedMessage={resendMessage} onDeleteMessage={deleteMessage} onPressMediaMessage={_onPressMediaMessage} + flatListComponent={flatListComponent} flatListProps={memoizedFlatListProps} />