diff --git a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js index 360540c61a2277..e10d1c4f3ecf60 100644 --- a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js +++ b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js @@ -248,7 +248,9 @@ class FlatListExample extends React.PureComponent { { onScroll={ this.state.horizontal ? this._scrollSinkX : this._scrollSinkY } + onScrollToIndexFailed={this._onScrollToIndexFailed} onViewableItemsChanged={this._onViewableItemsChanged} ref={this._captureRef} refreshing={false} @@ -369,6 +372,19 @@ class FlatListExample extends React.PureComponent { } : {renderItem: renderProp}; }; + + _onScrollToIndexFailed = ({ + index, + highestMeasuredFrameIndex, + }: { + index: number, + highestMeasuredFrameIndex: number, + }) => { + console.warn( + `failed to scroll to index: ${index} (measured up to ${highestMeasuredFrameIndex})`, + ); + }; + // This is called when items change viewability by scrolling into or out of // the viewable area. _onViewableItemsChanged = (info: {