react-chop

0.1.2 • Public • Published

react-chop

Build Status NPM version NPM license NPM total downloads NPM monthly downloads

A react-virtualized alternative without measuring.

Let the browser do its job — Ferran Basora

Check this out:

react-chop

Some demos: here

Install

npm install react-chop --save

or:

yarn add react-chop

Example

For example, take the following code:

import ChopList from 'react-chop';
 
const SIZE = 10000;
 
class App extends Component {
 
  constructor(props) {
    super(props);
 
    this.state = {
      list: Array.from({length: SIZE}, (_, i) => i)
    };
  }
 
  itemRenderer ({ key, index, style}) {
    const { list } = this.state;
 
    return (
        <div key={key} className='Item'>
          {list[index]}
        </div>
    )
  }
 
  render () {
    const { list } = this.state;
 
    <ChopList
      itemCount={list.length}
      itemRenderer={this.itemRenderer.bind(this)}
    />
  }
}

Package Sidebar

Install

npm i react-chop

Weekly Downloads

0

Version

0.1.2

License

MIT

Last publish

Collaborators

  • fcsonline