Skip to content

Commit eaeae73

Browse files
committed
Updates docs
1 parent ce120b3 commit eaeae73

File tree

5 files changed

+17
-227
lines changed

5 files changed

+17
-227
lines changed

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,27 @@ added. An infinite-scroll that actually works and super-simple to integrate!
1313
var InfiniteScroll = require('react-infinite-scroll-component');
1414
```
1515

16-
# demos
17-
- [See the demo in action at http://ankeetmaini.github.io/react-infinite-scroll-component/](http://ankeetmaini.github.io/react-infinite-scroll-component/). Thanks [@kdenz](https://github.com/kdenz)!
18-
- The code for demos is in the `demos/` directory. You can also clone and open `lib/index.html` in your browser to see the demos in action.
19-
2016
# using
2117

2218
```jsx
2319
<InfiniteScroll
24-
pullDownToRefresh
2520
dataLength={items.length} //This is important field to render the next data
26-
pullDownToRefreshContent={
27-
<h3 style={{textAlign: 'center'}}>&#8595; Pull down to refresh</h3>
28-
}
29-
releaseToRefreshContent={
30-
<h3 style={{textAlign: 'center'}}>&#8593; Release to refresh</h3>
31-
}
32-
refreshFunction={this.refresh}
3321
next={fetchData}
3422
hasMore={true}
3523
loader={<h4>Loading...</h4>}
3624
endMessage={
3725
<p style={{textAlign: 'center'}}>
3826
<b>Yay! You have seen it all</b>
3927
</p>
28+
}
29+
// below props only if you need pull down functionality
30+
refreshFunction={this.refresh}
31+
pullDownToRefresh
32+
pullDownToRefreshContent={
33+
<h3 style={{textAlign: 'center'}}>&#8595; Pull down to refresh</h3>
34+
}
35+
releaseToRefreshContent={
36+
<h3 style={{textAlign: 'center'}}>&#8593; Release to refresh</h3>
4037
}>
4138
{items}
4239
</InfiniteScroll>
@@ -52,6 +49,14 @@ The `InfiniteScroll` component can be used in three ways.
5249
# docs version wise
5350
[3.0.2](docs/README-3.0.2.md)
5451

52+
# live examples
53+
54+
- infinite scroll (never ending) example using react (body/window scroll)
55+
- [![Edit yk7637p62z](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/yk7637p62z)
56+
- infinte scroll till 500 elements (body/window scroll)
57+
- [![Edit 439v8rmqm0](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/439v8rmqm0)
58+
- infinite scroll in an element (div of height 400px)
59+
- [![Edit w3w89k7x8](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/w3w89k7x8)
5560

5661
# props
5762
name | type | description

demos/height.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

demos/index.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

demos/no-height.js

Lines changed: 0 additions & 75 deletions
This file was deleted.

server.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)