0.2.1 • Published 6 years ago

react-progressive-list-typescript v0.2.1

Weekly downloads
37
License
MIT
Repository
github
Last release
6 years ago
  1. written in typescript
  2. added a scrollBuffer so that you can start loading the next items before the end is reached

Read the blog post

React Progressive List is an alternative to React Virtualized. It wins in two possible scenarios:

  1. Your list rows are complex and slow to render. react-virtualized cannot render new rows fast enough to maintain a smooth 60fps scroll.
  2. You've tried react-virtualized and found it to be overly complicated for your basic needs.

Demo

Demo Site

Install

yarn add react-progressive-list-typescript

Example

  renderRow = index => {
    return <Row key={index} avatar={avatars[index]} name={names[index]} />;
  }

  render() {
    return (
      <ReactProgressiveList
        initialAmount={40}
        progressiveAmount={20}
        renderItem={this.renderRow}
        renderLoader={() => <Spinner />}
        rowCount={400}
        scrollBuffer={20}
        useWindowScroll
      />
    );
  }

Props

PropertyTypeDefaultDescription
classNamestringundefinedclassName to apply to the parent div
initialAmountnumber10initial number of rows to display
progressiveAmountnumber10number of rows to render each time a new batch is requested
idleAmountnumber0number of rows to render when the browser is idle (limited browser support for requestIdleCallback)
isActivebooleantruesetting to false will render the full list without any progressive loading
renderItem(index: number) => React.Noderequiredfunction that returns the row to render
renderLoader() => React.Node() => nullfunction that returns a loader to render
rowCountnumberrequiredthe length of your list
useWindowScrollbooleanfalseWhen true will use a scroll listener on the window, otherwise will use a scroll listener on the parent
scrollBuffernumber0How many pixels before the end is reached, should we start loading more items
0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago