From 6c36fcec18c2b77d2b61fd18ce6fab30dcd06992 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Fri, 26 Jan 2024 15:06:01 -0300 Subject: [PATCH] fix(newChatView): remove unnecessary dependencies in useEffect hooks to improve performance and prevent unnecessary re-renders --- src/frontend/src/components/newChatView/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/newChatView/index.tsx b/src/frontend/src/components/newChatView/index.tsx index a40c063ee..ec2c0d66c 100644 --- a/src/frontend/src/components/newChatView/index.tsx +++ b/src/frontend/src/components/newChatView/index.tsx @@ -57,17 +57,17 @@ export default function newChatView(): JSX.Element { return { isSend: !is_ai, message, sender_name }; }); setChatHistory(chatMessages); - }, [flowPool, outputIds]); + }, [flowPool]); useEffect(() => { if (messagesRef.current) { messagesRef.current.scrollTop = messagesRef.current.scrollHeight; } - }, [chatHistory]); + }, []); async function sendAll(data: sendAllProps): Promise {} useEffect(() => { if (ref.current) ref.current.scrollIntoView({ behavior: "smooth" }); - }, [chatHistory]); + }, []); const ref = useRef(null);