diff --git a/packages/uikit-react-native/src/components/ChannelInput/index.tsx b/packages/uikit-react-native/src/components/ChannelInput/index.tsx index d0f96366..a044efb6 100644 --- a/packages/uikit-react-native/src/components/ChannelInput/index.tsx +++ b/packages/uikit-react-native/src/components/ChannelInput/index.tsx @@ -19,7 +19,7 @@ import { import { useSendbirdChat } from '../../hooks/useContext'; import useMentionTextInput from '../../hooks/useMentionTextInput'; -import type { MentionedUser, Range } from '../../types'; +import type { CommonComponent, MentionedUser, Range } from '../../types'; import type { AttachmentsButtonProps } from './AttachmentsButton'; import AttachmentsButton from './AttachmentsButton'; import EditInput from './EditInput'; @@ -67,7 +67,7 @@ export type ChannelInputProps = { setMessageToReply?: (message?: undefined | SendbirdUserMessage | SendbirdFileMessage) => void; // mention - SuggestedMentionList?: (props: SuggestedMentionListProps) => React.ReactNode | null; + SuggestedMentionList?: CommonComponent; // sub-components AttachmentsButton?: (props: AttachmentsButtonProps) => React.ReactNode | null; diff --git a/packages/uikit-react-native/src/components/ChannelMessageList/index.tsx b/packages/uikit-react-native/src/components/ChannelMessageList/index.tsx index c1ce82b6..c9938cee 100644 --- a/packages/uikit-react-native/src/components/ChannelMessageList/index.tsx +++ b/packages/uikit-react-native/src/components/ChannelMessageList/index.tsx @@ -32,7 +32,6 @@ import { import type { UserProfileContextType } from '../../contexts/UserProfileCtx'; import { useLocalization, usePlatformService, useSendbirdChat, useUserProfile } from '../../hooks/useContext'; import SBUUtils from '../../libs/SBUUtils'; -import type { CommonComponent } from '../../types'; import ChatFlatList from '../ChatFlatList'; import { ReactionAddons } from '../ReactionAddons'; @@ -78,15 +77,10 @@ export type ChannelMessageListProps React.ReactElement | null; - renderNewMessagesButton: null | CommonComponent<{ - visible: boolean; - onPress: () => void; - newMessages: SendbirdMessage[]; - }>; - renderScrollToBottomButton: null | CommonComponent<{ - visible: boolean; - onPress: () => void; - }>; + renderNewMessagesButton: + | null + | ((props: { visible: boolean; onPress: () => void; newMessages: SendbirdMessage[] }) => React.ReactElement | null); + renderScrollToBottomButton: null | ((props: { visible: boolean; onPress: () => void }) => React.ReactElement | null); flatListProps?: Omit, 'data' | 'renderItem'>; } & { ref?: Ref> | undefined; diff --git a/packages/uikit-react-native/src/types.ts b/packages/uikit-react-native/src/types.ts index 9a5d32de..fc523db5 100644 --- a/packages/uikit-react-native/src/types.ts +++ b/packages/uikit-react-native/src/types.ts @@ -1,4 +1,4 @@ -import type { ErrorInfo, ReactNode } from 'react'; +import type { ComponentType, ErrorInfo, ReactNode } from 'react'; import type { SendbirdUser } from '@sendbird/uikit-utils'; @@ -17,7 +17,7 @@ export interface LocalCacheStorage { export type ErrorBoundaryProps = { error: Error; errorInfo: ErrorInfo; reset: () => void }; -export type CommonComponent

= (props: P & { children?: ReactNode }) => null | ReactNode; +export type CommonComponent

= ComponentType

; export type MentionedUser = { range: Range;