developerdizzle / react-virtual-list

Super simple virtualized list React component
http://developerdizzle.github.io/react-virtual-list/
MIT License
619 stars 73 forks source link

Error: Uncaught TypeError: Cannot read property 'firstItemIndex' of undefined #79

Closed studentIvan closed 5 years ago

studentIvan commented 5 years ago

With some rare probability I see this error on production. What may it mean? Can we solve it somehow?

studentIvan commented 5 years ago

on method setStateIfNeeded

if (state.firstItemIndex > state.lastItemIndex) { // on this line
    return;
}

if (state !== undefined && (state.firstItemIndex !== this.state.firstItemIndex || state.lastItemIndex !== this.state.lastItemIndex)) {
    this.setState(state);
}
studentIvan commented 5 years ago

Omg it's fixed in new version