Skip to content
Source
Sign inSign up
pingdotgg/t3code

Refactor ChatView into memoized UI subcomponents #58

Mergedjuliusmarmingemerged 2 commits intomain fromcodething/b1a7277cmerged by juliusmarminge View on GitHub

Showing 2 changed files with 4 additions and 1 deletion (loading 1).

x
0 of 2 viewed, 2 left
4 additions and 1 deletionapps/web/src/components/ChatMarkdown.tsxModified
View file
@@ -1,3 +1,4 @@
+import { memo } from "react";
import type { Components } from "react-markdown";
import ReactMarkdown from "react-markdown";
import rehypeHighlight from "rehype-highlight";
@@ -13,7 +14,7 @@
},
};
​
-export default function ChatMarkdown({ text }: ChatMarkdownProps) {
+function ChatMarkdown({ text }: ChatMarkdownProps) {
return (
<div className="chat-markdown text-sm leading-relaxed text-foreground/80">
<ReactMarkdown
@@ -26,3 +27,5 @@
</div>
);
+​
+export default memo(ChatMarkdown);
apps/web/src/components/ChatView.tsxModified
View file
Loading the diff