Add markdownHtml memoization in App.tsx
This commit is contained in:
@@ -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>();
|
||||||
|
|||||||
Reference in New Issue
Block a user