Skip to content

Commit

Permalink
prevent extra calls to scroll to bottom when messages length changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kesha-antonov committed Aug 24, 2024
1 parent 7d7abc3 commit fcbf9d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GiftedChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ function GiftedChat<TMessage extends IMessage = IMessage> (
useEffect(() => {
if (!inverted && messages?.length)
setTimeout(() => scrollToBottom(false), 200)
}, [messages, inverted, scrollToBottom])
}, [messages?.length, inverted, scrollToBottom])

useAnimatedReaction(
() => keyboard.height.value,
Expand Down

0 comments on commit fcbf9d2

Please # to comment.