chat: prevent message rerender
@@ -5,7 +5,8 @@ import { Message } from "./message";
import { Envelope } from "~/types/chat-update";
import _ from "lodash";
-export const ChatMessage = (props) => {
+export class ChatMessage extends PureComponent {
+ render() {
const {
msg,
previousMsg,
@@ -19,7 +20,7 @@ export const ChatMessage = (props) => {
hideNicknames,
remoteContentPolicy,
className = ''
- } = props;
+ } = this.props;
// Render sigil if previous message is not by the same sender
const aut = ["author"];
@@ -87,5 +88,5 @@ export const ChatMessage = (props) => {
} else {
return messageElem;
}
-};
-
+ }
+}
\ No newline at end of file
