ChatGPTNextWeb / ChatGPTNextWeb/NextChat
关于messages重复渲染的问题
- Dominant language
- TypeScript
- Stars
- 88.8k
- Forks
- 59.1k
- PR merge metrics
- No merged PRs in 30d
Description
### 🥰 需求描述
I have verified this project, and when there are many conversations and chats, the browser will get stuck and the memory will skyrocket. After checking the general reasons, I found that it is because all Message-items on the page will be rendered repeatedly when returning from each Q&A. I added console.log() to message.map, and found that message-item would be repeatedly rendered about 10 times when entering the page for the first time. When text stream was output, message-item would be repeatedly rendered and the number of rendering times was the length of text stream.


When there are 20-40 chats in a session or when the length of each text stream is much longer, the whole system freezes.
### 🧐 解决方案
Do not over-render, update only the corresponding message-item each time the text stream returns, and do not render the other message-items repeatedly
### 📝 补充信息
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.