Hi.
We would like to use our own chat message input in the UIKIt to send our messages. However, doing so prevents messages sent from the user to be inserted in the conversation. There must be some code that has to be called to update the conversation view after successfully posting a message to the Sendbird API.
If I refresh the page after posting the message with the custom messageInput, the message is shown properly.
<Channel
channelUrl={store.currentChannelUrl}
showSearchIcon={false}
useMessageGrouping={true}
renderMessageInput={() => (
<>
<input id="chat-input" type="text" />
<button onClick={(e) => {
const chatInput = document.getElementById('chat-input')
const message = chatInput.value
const params = new sb.UserMessageParams();
params.message = message;
store.currentChannel.sendUserMessage(params, function (message, error) {
if (error) {
console.error(error)
return
}
console.log('message sendUserMessage callback', message)
// HOW TO UPDATE THE CONVERSATION COMPONENT WITH THIS SUCCESSFULLY POSTED MESSAGE?
// HOW TO UPDATE THE CONVERSATION COMPONENT WITH THIS SUCCESSFULLY POSTED MESSAGE?
// HOW TO UPDATE THE CONVERSATION COMPONENT WITH THIS SUCCESSFULLY POSTED MESSAGE?
chatInput.value = ''
});
}}>Send message</button>
</>
)}
/>