Add markdownHtml memoization in App.tsx

This commit is contained in:
2026-02-01 03:51:53 +01:00
parent 8c1cf0e6a0
commit 97a3871a8d

View File

@@ -196,6 +196,10 @@ export default function App() {
const hasText = body.trim().length > 0; const hasText = body.trim().length > 0;
const showLineNumbersActive = showLineNumbers && !markdownPreview; const showLineNumbersActive = showLineNumbers && !markdownPreview;
const hasSearch = search.trim().length > 0; const hasSearch = search.trim().length > 0;
const markdownHtml = useMemo(
() => (markdownPreview ? markdownToHTML(body) : ""),
[body, markdownPreview]
);
const folderById = useMemo(() => { const folderById = useMemo(() => {
const map = new Map<string, Folder>(); const map = new Map<string, Folder>();