New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-progressive-list-typescript

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-progressive-list-typescript

forked from react-progressive-list, added TS and more features like buffer

latest
Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
195
8.94%
Maintainers
1
Weekly downloads
 
Created
Source
react-progressive-list

This is a fork to the original [react-progressive-list](https://www.npmjs.com/package/react-progressive-list) library but with some added features:
  • written in typescript
  • 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:

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

Demo

Demo Site

example

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

Keywords

react

FAQs

Package last updated on 19 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts