Skip to main content

useConversations

Introduction​

The useConversations hook provides you with the conversations of the currently opened chatroom. You can use this to create a custom UI for the message list.

PropertyTypeDescriptionOptional
conversationsConversation[] | nullList of chatroom conversations.✅
setChatroomTopicReact.Dispatch<Conversation | null>Sets the topic of the chatroom.❌
chatroomTopicConversation | nullCurrent chatroom topic.✅
setConversationsReact.Dispatch<Conversation[] | null>Updates the list of conversations.❌
getChatroomConversationsOnTopScrollFunctionFetches conversations when scrolling to the top.❌
getChatroomConversationsOnBottomScrollFunctionFetches conversations when scrolling to the bottom.❌
loadMorebooleanIndicates if more conversations can be loaded.❌
showLoaderMutableRefObject<boolean>Controls whether a loader is displayed.❌
showSkeletonResponsebooleanIndicates if a skeleton response should be shown.❌
bottomReferenceDivMutableRefObject<HTMLDivElement | null>Reference for the bottom of the conversation list.❌
messageListContainerRefMutableRefObject<HTMLDivElement | null>Reference for the message list container.❌
unBlockUserInDMZeroArgVoidReturnsUnblocks a user in a direct message.❌
searchedConversationRefMutableRefObject<HTMLDivElement | null>Reference for a searched conversation.❌
loadMoreBottomConversationbooleanIndicates if more conversations can be loaded at the bottom.❌
shouldScrollToBottomMutableRefObject<boolean>Controls whether the conversation list should auto-scroll down.❌

Reference​

For reference checkout this file