From 9766606c724bcef5c8c6817fc7d41f2f2d5e7616 Mon Sep 17 00:00:00 2001 From: serhat Date: Sat, 24 Feb 2024 18:48:47 +0300 Subject: [PATCH] fix --- web-app/src/components/site/indexes/AskIndexes/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web-app/src/components/site/indexes/AskIndexes/index.tsx b/web-app/src/components/site/indexes/AskIndexes/index.tsx index 572634dd..c3449535 100644 --- a/web-app/src/components/site/indexes/AskIndexes/index.tsx +++ b/web-app/src/components/site/indexes/AskIndexes/index.tsx @@ -14,6 +14,7 @@ import FlexRow from "components/layout/base/Grid/FlexRow"; import { ComponentProps, FC, + useCallback, useEffect, useMemo, useRef, @@ -148,9 +149,9 @@ const AskIndexes: FC = ({ chatID, did, indexIds }) => { }, }); - const scrollToBottom = () => { + const scrollToBottom = useCallback(() => { bottomRef.current?.scrollIntoView({ behavior: "smooth" }); - }; + }, [bottomRef]); useEffect(() => { scrollToBottom();