Invariant Violation: scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures.
<FlatList
ref={fListRef}
onScrollToIndexFailed={info => {
const wait = new Promise(resolve => setTimeout(resolve, 700));
wait.then(() => {
fListRef.current?.scrollToIndex({ index: info.index, animated: true/false });
});
}}
/>
https://github.com/facebook/react-native/issues/14198