We’re working on our first Sendbird-based application and decided to try out the React UIKit to speed things up. Our use case involves a lot of links being sent between users who might be slightly less technical, so we’d like to make it as easy as possible to spot and interact with links.
Right now, if I send a message with
https://www.google.com, it comes through as the text
https://www.google.com/ instead of turning into a stylized, clickable link like in Slack / Discord / etc. We could override
renderChatItem and write a custom renderer, but then we’re responsible for overloading a lot of behavior from the base implementation such as file / image previews, day separators, etc. We’d love to reuse as much of your hard work as possible and just override this one case for link rendering.
From digging through the source code of the
sendbird-uikit React library, it looks like there is a
MessageHOC component that handles the more complex rendering logic, but it’s not currently exported, so I assume it’s an internal-only API. I also see methods like
onMessageReceived, but I don’t see ways to override those at the moment.
Is there a way for us to only override rendering for messages that contain links? Or some way to pre-process messages and replace text with links as appropriate? Or do we need to write our own rendering engine using
renderChatItem just to enable this one case?