setTimeout(() => { this.myFlatList.scrollToIndex({animated:true , index: 100}) }, 100);
If i use scrolltoindex in flat list return to me this error;
scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed
I tried to use getItemLayout but my flatlist items have different height, how can i fix this?
getItemLayout={(data, index) => (
{length: 40, offset: 40 * index, index}
)}