Skip to content

Commit d6c65ed

Browse files
committed
Merge branch 'master' of https://github.com/ankeetmaini/react-infinite-scroll-component into fix-UNSAFE_componentWillReceiveProps
2 parents bf71c05 + 445146a commit d6c65ed

File tree

5 files changed

+80
-18
lines changed

5 files changed

+80
-18
lines changed

.all-contributorsrc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"files": [
3+
"README.md"
4+
],
5+
"imageSize": 100,
6+
"contributorsPerLine": 5,
7+
"skipCi": true,
8+
"contributors": [
9+
{
10+
"login": "ankeetmaini",
11+
"name": "Ankeet Maini",
12+
"avatar_url": "https://avatars.githubusercontent.com/u/6652823?v=4",
13+
"profile": "https://ankeetmaini.dev/",
14+
"contributions": [
15+
"question",
16+
"doc",
17+
"code",
18+
"review",
19+
"maintenance"
20+
]
21+
},
22+
{
23+
"login": "iamdarshshah",
24+
"name": "Darsh Shah",
25+
"avatar_url": "https://avatars.githubusercontent.com/u/25670841?v=4",
26+
"profile": "https://github.com/iamdarshshah",
27+
"contributions": [
28+
"infra"
29+
]
30+
}
31+
],
32+
"projectName": "react-infinite-scroll-component",
33+
"projectOwner": "ankeetmaini",
34+
"repoType": "github",
35+
"repoHost": "https://github.com"
36+
}

README.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# react-infinite-scroll-component [![npm](https://img.shields.io/npm/dt/react-infinite-scroll-component.svg?style=flat-square)](https://www.npmjs.com/package/react-infinite-scroll-component) [![npm](https://img.shields.io/npm/v/react-infinite-scroll-component.svg?style=flat-square)](https://www.npmjs.com/package/react-infinite-scroll-component)
2+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
4+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
25

36
A component to make all your infinite scrolling woes go away with just 4.15 kB! `Pull Down to Refresh` feature
47
added. An infinite-scroll that actually works and super-simple to integrate!
58

6-
# install
9+
## Install
710

811
```bash
912
npm install --save react-infinite-scroll-component
@@ -18,7 +21,7 @@ added. An infinite-scroll that actually works and super-simple to integrate!
1821
var InfiniteScroll = require('react-infinite-scroll-component');
1922
```
2023

21-
# using
24+
## Using
2225

2326
```jsx
2427
<InfiniteScroll
@@ -46,7 +49,7 @@ added. An infinite-scroll that actually works and super-simple to integrate!
4649
</InfiniteScroll>
4750
```
4851

49-
# using scroll on top
52+
## Using scroll on top
5053

5154
```jsx
5255
<div
@@ -83,11 +86,11 @@ The `InfiniteScroll` component can be used in three ways.
8386
- If your **scrollable** content is being rendered within a parent element that is already providing overflow scrollbars, you can set the `scrollableTarget` prop to reference the DOM element and use it's scrollbars for fetching more data.
8487
- Without setting either the `height` or `scrollableTarget` props, the scroll will happen at `document.body` like _Facebook's_ timeline scroll.
8588

86-
# docs version wise
89+
## docs version wise
8790

8891
[3.0.2](docs/README-3.0.2.md)
8992

90-
# live examples
93+
## live examples
9194

9295
- infinite scroll (never ending) example using react (body/window scroll)
9396
- [![Edit yk7637p62z](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/yk7637p62z)
@@ -98,7 +101,7 @@ The `InfiniteScroll` component can be used in three ways.
98101
- infinite scroll with `scrollableTarget` (a parent element which is scrollable)
99102
- [![Edit r7rp40n0zm](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/r7rp40n0zm)
100103

101-
# props
104+
## props
102105

103106
| name | type | description |
104107
| ------------------------------ | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -122,3 +125,28 @@ The `InfiniteScroll` component can be used in three ways.
122125
| **refreshFunction** | function | this function will be called, it should return the fresh data that you want to show the user |
123126
| **initialScrollY** | number | set a scroll y position for the component to render with. |
124127
| **inverse** | bool | set infinite scroll on top |
128+
129+
## Contributors ✨
130+
131+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
132+
133+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
134+
<!-- prettier-ignore-start -->
135+
<!-- markdownlint-disable -->
136+
<table>
137+
<tr>
138+
<td align="center"><a href="https://ankeetmaini.dev/"><img src="https://avatars.githubusercontent.com/u/6652823?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ankeet Maini</b></sub></a><br /><a href="#question-ankeetmaini" title="Answering Questions">💬</a> <a href="https://github.com/ankeetmaini/react-infinite-scroll-component/commits?author=ankeetmaini" title="Documentation">📖</a> <a href="https://github.com/ankeetmaini/react-infinite-scroll-component/commits?author=ankeetmaini" title="Code">💻</a> <a href="https://github.com/ankeetmaini/react-infinite-scroll-component/pulls?q=is%3Apr+reviewed-by%3Aankeetmaini" title="Reviewed Pull Requests">👀</a> <a href="#maintenance-ankeetmaini" title="Maintenance">🚧</a></td>
139+
<td align="center"><a href="https://github.com/iamdarshshah"><img src="https://avatars.githubusercontent.com/u/25670841?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Darsh Shah</b></sub></a><br /><a href="#infra-iamdarshshah" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
140+
</tr>
141+
</table>
142+
143+
<!-- markdownlint-restore -->
144+
<!-- prettier-ignore-end -->
145+
146+
<!-- ALL-CONTRIBUTORS-LIST:END -->
147+
148+
This project follows the [all-contributors](https://allcontributors.org) specification. Contributions of any kind are welcome!
149+
150+
## LICENSE
151+
152+
[MIT](LICENSE)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-infinite-scroll-component",
3-
"version": "5.1.0",
3+
"version": "6.0.0",
44
"description": "An Infinite Scroll component in react.",
55
"source": "src/index.tsx",
66
"main": "dist/index.js",

src/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export default class InfiniteScroll extends Component<Props, State> {
242242
if (this._infScroll) {
243243
this._infScroll.style.overflow = 'auto';
244244
this._infScroll.style.transform = 'none';
245-
this._infScroll.style.willChange = 'none';
245+
this._infScroll.style.willChange = 'unset';
246246
}
247247
});
248248
};
@@ -258,15 +258,13 @@ export default class InfiniteScroll extends Component<Props, State> {
258258
if (threshold.unit === ThresholdUnits.Pixel) {
259259
return (
260260
target.scrollTop <=
261-
threshold.value + clientHeight - target.scrollHeight + 1 ||
262-
target.scrollTop === 0
261+
threshold.value + clientHeight - target.scrollHeight + 1
263262
);
264263
}
265264

266265
return (
267266
target.scrollTop <=
268-
threshold.value / 100 + clientHeight - target.scrollHeight + 1 ||
269-
target.scrollTop === 0
267+
threshold.value / 100 + clientHeight - target.scrollHeight + 1
270268
);
271269
}
272270

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5771,9 +5771,9 @@ [email protected]:
57715771
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
57725772

57735773
ini@^1.3.5, ini@~1.3.0:
5774-
version "1.3.5"
5775-
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
5776-
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
5774+
version "1.3.8"
5775+
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
5776+
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
57775777

57785778
57795779
version "6.5.0"
@@ -7440,9 +7440,9 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1:
74407440
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
74417441

74427442
nested-object-assign@^1.0.3:
7443-
version "1.0.3"
7444-
resolved "https://registry.yarnpkg.com/nested-object-assign/-/nested-object-assign-1.0.3.tgz#5aca69390d9affe5a612152b5f0843ae399ac597"
7445-
integrity sha512-kgq1CuvLyUcbcIuTiCA93cQ2IJFSlRwXcN+hLcb2qLJwC2qrePHGZZa7IipyWqaWF6tQjdax2pQnVxdq19Zzwg==
7443+
version "1.0.4"
7444+
resolved "https://registry.yarnpkg.com/nested-object-assign/-/nested-object-assign-1.0.4.tgz#c9db56078eb6043960fdb6ba918a5122a06ccac4"
7445+
integrity sha512-FlZ7oN9ICt+fbcJ4ag2IsALIcalfE/E16ttdSA8peBiHJI+oEKdOcafqDnUbeUe5NwWGn/m9zZGO9qrAGzfesg==
74467446

74477447
next-tick@^1.0.0:
74487448
version "1.0.0"

0 commit comments

Comments
 (0)