CometChatConversationsWithMessages
. This single component provided end-to-end functionality, including listing conversations, handling conversation clicks, loading messages (message header, list, composer), displaying user or group details, and supporting threaded messages. Developers could achieve all these features with minimal setup. However, customization posed significant challenges. Customizing the UI or adding custom views required a deep understanding of the internal flow of the composite component. Additionally, configurations were a mix of custom view props, behavioural props, and style props, which often led to confusion. Styling deeply nested components also proved cumbersome, limiting the developer’s ability to make meaningful changes.
Conversations
, Message Header
, Message List
, and Message Composer
. This modular approach makes integration more flexible and easier to understand. Each component has a well-defined purpose, allowing developers to use them in ways that suit their specific requirements. The need for complex configurations has been eliminated, as developers can now customize behavior and styling directly via props or CSS. Styling has been significantly simplified, with every component carefully assigned thoughtful CSS class names, enabling developers to customize styles globally or at the component level effortlessly.
To support the transition from v4 to v5, CometChat has built a sample app that replicates the functionality of v4’s composite components. This sample app serves as a reference for developers looking to build additional features such as user/group details, call log details, threaded messages, and advanced messaging capabilities. By following this approach, developers can take full advantage of v5’s modular design while implementing complex functionality in an organized manner.
CometChatConversationsWithMessages
, which offered end-to-end functionality. These components integrated features such as conversation lists, message views (header, list, composer), user/group details, and threaded messages into a single unit. However, customization of deeply nested components through configuration was challenging and resulted in a suboptimal developer experience.
Components in v4 UI Kit: | ||
---|---|---|
CometChatConversationsWithMessages | CometChatUsersWithMessages | CometChatGroupsWithMessages |
CometChatMessages | CometChatMessageHeader | CometChatMessageList |
CometChatMessageComposer | CometChatThreadedMessages | CometChatConversations |
CometChatUsers | CometChatGroups | CometChatContacts |
CometChatDetails | CometChatGroupMembers | CometChatAddMembers |
CometChatBannedMembers | CometChatTransferOwnership | CometChatMessageInformation |
CometChatIncomingCall | CometChatOngoingCall | CometChatOutgoingCall |
CometChatCallButtons | CometChatCallLogs | CometChatCallLogDetails |
CometChatCallLogHistory | CometChatCallLogRecordings | CometChatCallLogParticipants |
CometChatCallLogsWithDetails | CometChatUserMemberWrapper |
Conversations
, Message Header
, Message List
, and Message Composer
. Developers now need to stitch these components together to build the desired functionality. This change allows for greater flexibility and easier customization via props, significantly improving the developer experience while maintaining functionality.
Components in v5 UI Kit: | ||
---|---|---|
CometChatConversations | CometChatUsers | CometChatGroups |
CometChatGroupMembers | CometChatMessageHeader | CometChatMessageList |
CometChatMessageComposer | CometChatThreadedMessagePreview | CometChatIncomingCall |
CometChatOutgoingCall | CometChatCallButtons | CometChatCallLogs |
setAccent50()
, setPrimary()
, and setMode()
for configuring colors and themes. The theming system relied heavily on React’s Context API, utilizing CometChatThemeProvider and CometChatThemeContext to retrieve and update theme settings. While Context is a core concept in React, it wasn’t the most intuitive or efficient approach for theming.
The reliance on Context for theming introduced several challenges. Customizing themes often required developers to consume the theme from the context and then explicitly update values programmatically, which added unnecessary complexity. For example, switching between light and dark modes required interacting with the theme’s context and invoking specific methods like setMode()
. This process was less straightforward compared to the traditional approach of using CSS class names or data attributes to define themes dynamically. Furthermore, this method wasn’t as idiomatic to modern frontend development practices, where CSS-based theming provides simplicity, flexibility, and better alignment with browser capabilities.
App.tsx
itemView
, leadingView
, trailingView
, subtitleView
& titleView
. This consistent naming convention makes it easier for developers to understand and apply customizations across various components, streamlining the development process.
For a comprehensive overview of newly added, renamed, and removed properties, refer to the Property Changes Documentation.