diff --git a/react-list.es6 b/react-list.es6 index 0d6fd2d..db70caf 100644 --- a/react-list.es6 +++ b/react-list.es6 @@ -332,6 +332,10 @@ module.exports = class ReactList extends Component { } cacheSizes() { + // is hidden + if (findDOMNode(this).offsetParent === null) { + return; + } const {cache} = this; const {from} = this.state; const itemEls = findDOMNode(this.items).children; diff --git a/react-list.js b/react-list.js index 4706aa4..012dea0 100644 --- a/react-list.js +++ b/react-list.js @@ -448,6 +448,10 @@ }, { key: 'cacheSizes', value: function cacheSizes() { + // is hidden + if (findDOMNode(this).offsetParent === null) { + return; + } var cache = this.cache; var from = this.state.from;