diff --git a/src/VirtualList.js b/src/VirtualList.js index dc87a5c..75d849e 100644 --- a/src/VirtualList.js +++ b/src/VirtualList.js @@ -49,6 +49,8 @@ const VirtualList = (options, mapVirtualToProps = defaultMapToVirtualProps) => ( setStateIfNeeded(list, container, items, itemHeight, itemBuffer) { // get first and lastItemIndex const state = getVisibleItemBounds(list, container, items, itemHeight, itemBuffer); + + if (state.firstItemIndex > state.lastItemIndex) { return; } if (state !== undefined && (state.firstItemIndex !== this.state.firstItemIndex || state.lastItemIndex !== this.state.lastItemIndex)) { this.setState(state);