Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Support for [email protected] and up #81

Merged
merged 3 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"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"
},
"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"
Expand Down
3 changes: 0 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions src/LazyList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'

const proxyMethods = [
'getOffset',
'getScrollParent',
'getScroll',
'setScroll',
'getViewportSize',
Expand Down Expand Up @@ -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
}
Expand Down