forked from XiaoMo/ChatGPT-Next-Web
Merge pull request #496 from quark-zju/m/memo-markdown
perf: memorize markdown rendering
This commit is contained in:
commit
17d6f3d715
@ -1,5 +1,5 @@
|
||||
import { useDebouncedCallback } from "use-debounce";
|
||||
import { useState, useRef, useEffect, useLayoutEffect } from "react";
|
||||
import { memo, useState, useRef, useEffect, useLayoutEffect } from "react";
|
||||
|
||||
import SendWhiteIcon from "../icons/send-white.svg";
|
||||
import BrainIcon from "../icons/brain.svg";
|
||||
@ -33,7 +33,7 @@ import chatStyle from "./chat.module.scss";
|
||||
|
||||
import { Modal, showModal, showToast } from "./ui-lib";
|
||||
|
||||
const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
|
||||
const Markdown = dynamic(async () => memo((await import("./markdown")).Markdown), {
|
||||
loading: () => <LoadingIcon />,
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user