dtinth / ThreadGPT

Alternative frontend to ChatGPT (gpt-3.5-turbo / gpt-4) with a thread-based interface
https://threadgpt.vercel.app
80 stars 23 forks source link

Issue 5: Reduce re-rendering of useThreadIndent / Reduce duplicated code #16

Closed fResult closed 1 year ago

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
thread-gpt ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 12, 2023 at 6:32PM (UTC)
dtinth commented 1 year ago

When resizing this caused all the component to render on every resize. I’ll add another commit to make this more optimal krub.

https://user-images.githubusercontent.com/193136/224563932-074860af-f5e3-4a6a-87e4-76d6660b8050.mov

dtinth commented 1 year ago

Fixed in commit 91ad55a.

After the fix:

https://user-images.githubusercontent.com/193136/224564636-4890537c-31b6-46d3-9c68-c8ad2b8ff87b.mov

When optimizing React, I recommend turning on React Devtools and enable "Highlight updates when components render." It can help uncover inefficiencies.