[MM-16456] Ensure Flatlist is mounted prior to calling scrollToOffset (#2925)
* Ensure Flatlist is mounted prior to calling scrollToOffset * Make linter happy
This commit is contained in:
parent
c121f66526
commit
fdb6cc6b2a
1 changed files with 3 additions and 1 deletions
|
|
@ -281,7 +281,9 @@ export default class PostList extends PureComponent {
|
|||
|
||||
scrollToBottom = () => {
|
||||
setTimeout(() => {
|
||||
this.flatListRef.current.scrollToOffset({offset: 0, animated: true});
|
||||
if (this.flatListRef && this.flatListRef.current) {
|
||||
this.flatListRef.current.scrollToOffset({offset: 0, animated: true});
|
||||
}
|
||||
}, 250);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue