1.1.2 • Published 2 years ago

bx-stable-infinite-scroll v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

📜 bx-stable-infinite-scroll

Demo

Stable bi-directional infinite scroll React component. Load additional data from both ends of a container while maintaining current view. Used for chat, timeline, feed views.

npm.io

Documentation

Installation

npm install --save bx-stable-infinite-scroll

# or

yarn add bx-stable-infinite-scroll

Usage

PropTypeDescription
loadingComponentReactNodeWhat to display when fetching more data (e.g. <div>Loading...</div>).
nextDataFn() => voidFunction to fetch next rows.
nextEndbooleanNo more next rows to fetch.
nextLoadingbooleanFetching next rows.
previousDataFn() => voidFunction to fetch previous rows.
previousEndbooleanNo more previous rows to fetch.
previousLoadingbooleanFetching previous rows.
initialReverse?booleanIndicate whether data will initially be loaded from top or bottom of container. Default true (loading data from top).
childrenReactNodeRows to render

See demo code for detailed usage example.

🚨 Use unique keys for children

Make sure the elements you're passing into <BxInfiniteScroll> have unique and consistent keys.

<BxInfiniteScroll {...props}>
  {map(rows, (row) => {
    return <div key={row.id}>{row.content}</div>
  })}
</BxInfiniteScroll>
1.1.1

2 years ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.1.2

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago