mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	Merge pull request #496 from quark-zju/m/memo-markdown
perf: memorize markdown rendering
This commit is contained in:
		@@ -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 />,
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user