From fcbf9d2319ad0cac3685627f6914894882969c01 Mon Sep 17 00:00:00 2001 From: Kesha Antonov Date: Sat, 24 Aug 2024 09:26:49 +0300 Subject: [PATCH] prevent extra calls to scroll to bottom when messages length changes --- src/GiftedChat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GiftedChat.tsx b/src/GiftedChat.tsx index 5fce99797..d5d401b62 100644 --- a/src/GiftedChat.tsx +++ b/src/GiftedChat.tsx @@ -547,7 +547,7 @@ function GiftedChat ( useEffect(() => { if (!inverted && messages?.length) setTimeout(() => scrollToBottom(false), 200) - }, [messages, inverted, scrollToBottom]) + }, [messages?.length, inverted, scrollToBottom]) useAnimatedReaction( () => keyboard.height.value,