React Chat - Custom Deleted Message

To change the "This message was deleted" text in deleted messages, create a messageTemplate. The following code snippet shows how to replace the default text with a "trash" icon:

App.js
  • import React from "react";
  • import Chat from "devextreme-react/chat";
  •  
  • const messageRender = (data) => {
  • if (data.message.isDeleted) {
  • return <i class="dx-icon-trash"></i>;
  • }
  • return <div>{data.message.text}</div>;
  • }
  •  
  • const App = () => {
  • return (
  • <Chat
  • messageRender={messageRender}
  • />
  • );
  • };