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.
| Property | Type | Description | Optional |
|---|---|---|---|
| conversations | Conversation[] | null | List of chatroom conversations. | ✅ |
| setChatroomTopic | React.Dispatch<Conversation | null> | Sets the topic of the chatroom. | ❌ |
| chatroomTopic | Conversation | null | Current chatroom topic. | ✅ |
| setConversations | React.Dispatch<Conversation[] | null> | Updates the list of conversations. | ❌ |
| getChatroomConversationsOnTopScroll | Function | Fetches conversations when scrolling to the top. | ❌ |
| getChatroomConversationsOnBottomScroll | Function | Fetches conversations when scrolling to the bottom. | ❌ |
| loadMore | boolean | Indicates if more conversations can be loaded. | ❌ |
| showLoader | MutableRefObject<boolean> | Controls whether a loader is displayed. | ❌ |
| showSkeletonResponse | boolean | Indicates if a skeleton response should be shown. | ❌ |
| bottomReferenceDiv | MutableRefObject<HTMLDivElement | null> | Reference for the bottom of the conversation list. | ❌ |
| messageListContainerRef | MutableRefObject<HTMLDivElement | null> | Reference for the message list container. | ❌ |
| unBlockUserInDM | ZeroArgVoidReturns | Unblocks a user in a direct message. | ❌ |
| searchedConversationRef | MutableRefObject<HTMLDivElement | null> | Reference for a searched conversation. | ❌ |
| loadMoreBottomConversation | boolean | Indicates if more conversations can be loaded at the bottom. | ❌ |
| shouldScrollToBottom | MutableRefObject<boolean> | Controls whether the conversation list should auto-scroll down. | ❌ |
Reference
For reference checkout this file