React-Native: Getting an error when scrollToIndex using FlatList ref

Try this one adding onScrollToIndexFailed function

<FlatList
  ref={fListRef}
  onScrollToIndexFailed={info => {
    const wait = new Promise(resolve => setTimeout(resolve, 700));
    wait.then(() => {
      fListRef.current?.scrollToIndex({ index: info.index, animated: true/false });
    });
  }}
/>

You can checkout git repo as well :: https://github.com/facebook/react-native/issues/14198

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top