From 5a3b567f50364ce6aa842ea19aa1850c0f91c5b0 Mon Sep 17 00:00:00 2001 From: Danil Valov Date: Mon, 13 Jan 2025 17:45:41 +0600 Subject: [PATCH] Fix incorrect props for `` component --- src/GiftedChat.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/GiftedChat.tsx b/src/GiftedChat.tsx index 5403b8233..3da81d9fd 100644 --- a/src/GiftedChat.tsx +++ b/src/GiftedChat.tsx @@ -38,7 +38,7 @@ import { GiftedChatContext } from './GiftedChatContext' import { InputToolbar, InputToolbarProps } from './InputToolbar' import { LoadEarlier, LoadEarlierProps } from './LoadEarlier' import Message from './Message' -import MessageContainer from './MessageContainer' +import MessageContainer, { MessageContainerProps } from './MessageContainer' import { MessageImage, MessageImageProps } from './MessageImage' import { MessageText, MessageTextProps } from './MessageText' import { @@ -66,9 +66,9 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context' dayjs.extend(localizedFormat) -export interface GiftedChatProps extends Partial, 'scrollToBottom'>> { +export interface GiftedChatProps extends Partial> { /* Message container ref */ - messageContainerRef?: React.RefObject> + messageContainerRef?: React.RefObject> /* text input ref */ textInputRef?: React.RefObject /* Messages to display */ @@ -204,7 +204,7 @@ export interface GiftedChatProps extends P /* Custom time inside a message */ renderTime?(props: TimeProps): React.ReactNode /* Custom footer component on the ListView, e.g. 'User is typing...' */ - renderFooter?(): React.ReactNode + renderFooter?(props: MessageContainerProps): React.ReactNode /* Custom component to render in the ListView when messages are empty */ renderChatEmpty?(): React.ReactNode /* Custom component to render below the MessageContainer (separate from the ListView) */ @@ -239,7 +239,7 @@ export interface GiftedChatProps extends P } function GiftedChat ( - props: GiftedChatProps + props: GiftedChatProps ) { const { messages = [], @@ -273,7 +273,7 @@ function GiftedChat ( const actionSheetRef = useRef(null) const messageContainerRef = useMemo( - () => props.messageContainerRef || createRef>(), + () => props.messageContainerRef || createRef>(), [props.messageContainerRef] ) @@ -387,7 +387,7 @@ function GiftedChat ( const fragment = ( - {...messagesContainerProps} invertibleScrollViewProps={{ inverted,