[MM-17016] Ensure Flatlist is mounted prior to calling scrollToIndex (#2977)
* Ensure Flatlist is mounted prior to calling scrollToIndex * Address review comment
This commit is contained in:
parent
175c0df5d9
commit
085a3ecf6c
1 changed files with 2 additions and 1 deletions
|
|
@ -291,7 +291,8 @@ export default class PostList extends PureComponent {
|
|||
width > 0 &&
|
||||
height > 0 &&
|
||||
this.props.initialIndex > 0 &&
|
||||
!this.hasDoneInitialScroll
|
||||
!this.hasDoneInitialScroll &&
|
||||
this.flatListRef?.current
|
||||
) {
|
||||
requestAnimationFrame(() => {
|
||||
this.flatListRef.current.scrollToIndex({
|
||||
|
|
|
|||
Loading…
Reference in a new issue