Skip to content

Commit 0fd50c1

Browse files
authored
Merge pull request #24108 from Pujan92/fix/23874
Fix: iOS/iPad - Chat - Message “User is typing” is not showing
2 parents fb53a49 + b0ab02b commit 0fd50c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hooks/useReportScrollManager/index.native.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useContext} from 'react';
1+
import {useContext, useCallback} from 'react';
22
import ReportScreenContext from '../../pages/home/ReportScreenContext';
33

44
function useReportScrollManager() {
@@ -20,13 +20,13 @@ function useReportScrollManager() {
2020
/**
2121
* Scroll to the bottom of the flatlist.
2222
*/
23-
const scrollToBottom = () => {
23+
const scrollToBottom = useCallback(() => {
2424
if (!flatListRef.current) {
2525
return;
2626
}
2727

2828
flatListRef.current.scrollToOffset({animated: false, offset: 0});
29-
};
29+
}, [flatListRef]);
3030

3131
return {ref: flatListRef, scrollToIndex, scrollToBottom};
3232
}

0 commit comments

Comments
 (0)