perf: close #909 reduce message items render time

This commit is contained in:
Yidadaa
2023-05-02 00:31:44 +08:00
parent 8f5c289818
commit a69cec89fb
2 changed files with 61 additions and 57 deletions

View File

@@ -1,5 +1,5 @@
import { useDebouncedCallback } from "use-debounce";
import { memo, useState, useRef, useEffect, useLayoutEffect } from "react";
import { useState, useRef, useEffect, useLayoutEffect } from "react";
import SendWhiteIcon from "../icons/send-white.svg";
import BrainIcon from "../icons/brain.svg";
@@ -64,12 +64,9 @@ import {
useMaskStore,
} from "../store/mask";
const Markdown = dynamic(
async () => memo((await import("./markdown")).Markdown),
{
loading: () => <LoadingIcon />,
},
);
const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
loading: () => <LoadingIcon />,
});
function exportMessages(messages: Message[], topic: string) {
const mdText =