diff --git a/package.json b/package.json index 8e9570e..049e75a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "cross-env": "^7.0.0", "react": "^16.3.2", "react-dom": "^16.3.2", - "react-list": "^0.8.8 < 0.8.10", + "react-list": "^0.8.8 < 0.8.10 || ^0.8.10", "rollup": "^1.0.0", "rollup-plugin-babel": "^4.0.2", "standard": "^14.0.0" @@ -36,7 +36,7 @@ "peerDependencies": { "react": "^0.14.0 || ^15.0.0 || ^16.0.0", "react-dom": "^0.14.0 || ^ 15.0.0 || ^16.0.0", - "react-list": "^0.7.0 || ^0.8.0 < 0.8.10" + "react-list": "^0.7.0 || ^0.8.0 < 0.8.10 || ^0.8.10" }, "standard": { "parser": "babel-eslint" diff --git a/readme.md b/readme.md index 750f0e9..9ee79e6 100644 --- a/readme.md +++ b/readme.md @@ -24,9 +24,6 @@ infinite scrolling. npm install --save react-list-lazy-load ``` -> :warning: At the moment, react-list-lazy-load only works with react-list -> versions up to v0.8.9. Versions v0.8.10 and up are not yet supported. - ## Usage [Demo](https://u-wave.github.io/react-list-lazy-load) - [Demo source code](./example.js) diff --git a/src/LazyList.js b/src/LazyList.js index e134b41..25d8b94 100644 --- a/src/LazyList.js +++ b/src/LazyList.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types' const proxyMethods = [ 'getOffset', - 'getScrollParent', 'getScroll', 'setScroll', 'getViewportSize', @@ -64,7 +63,9 @@ class LazyList extends React.Component { updateScrollParent () { const prev = this.scrollParent - this.scrollParent = this.getScrollParent() + const list = this.getList() + this.scrollParent = list.scrollParent + if (prev === this.scrollParent) { return }