1.3.0 • Published 8 months ago

react-visual-window v1.3.0

Weekly downloads
48
License
MIT
Repository
github
Last release
8 months ago

react-visual-window

React components for fast and efficiently rendering large lists

Heavily inspired by react-window

React window works by only rendering part of a large data set (just enough to fill the viewport). This helps address some common performance bottlenecks: 1. It reduces the amount of work (and time) required to render the initial view and to process updates. 2. It reduces the memory footprint by avoiding over-allocation of DOM nodes.

Coverage Status NPM registry bundlephobia NPM license

Install

# Yarn
yarn add react-visual-window

# NPM
npm install --save react-visual-window

Usage

import VisualWindow from "react-visual-window";

const data = new Array(1000).fill(true).map((_, x) => ({
    odd: x % 2 !== 0,
}));

const Row = forwardRef((props, ref) => {
    const { data, index, style } = props;
    return (
        <div ref={ref} style={style}>
            <div>
                Row {index} - odd: {data[index].odd ? `true` : `false`}
            </div>
        </div>
    );
});


export default function App() {
    return (
        <div className="App">
            <VisualWindow
                defaultItemHeight={18}
                itemData={data}
                className="tableClass"
            >
                {Row}
            </VisualWindow>
        </div>
    );
}

License

MIT © n33pm

1.3.0

8 months ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago