1.1.1 • Published 5 years ago

@tenchleb/react-virtual-scroll v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Virtual Scroll

Installation

npm install @tenchleb/react-virtual-scroll

Usage

import { VirtualScroll } from "@tenchleb/react-virtual-scroll";

const styles = {
    display: "flex",
    maxHeight: "256px",
    width: "100%"
};

export class X extends React.PureComponent {
    ...
    render() {
        return (
            <div style={ styles }>
                <VirtualScroll height={ 64 }>
                    {
                        list.map(element => (
                            <span> { element.name } </span>
                        ))
                    }
                </VirtualScroll>
            </div>
        );
    }
}

Example: https://codesandbox.io/s/rmy3xoq2n