0.0.1 • Published 4 years ago

go-virtualize v0.0.1

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

go-virtualize

Virtualize big data for React

Install

npm i go-virtualize
yarn add go-virtualize

Usage

import { Virtualize, VirtualizedComponentProps } from "go-virtualize";

function Row({ column, row, children, key }: VirtualizedComponentProps) {
  return (
    <div key={key} className="row">
      {children}
    </div>
  );
}

function Column({ column, row, key }: VirtualizedComponentProps) {
  return (
    <div key={key} className="column">
      {column}, {row}
    </div>
  );
}

function App() {
  return (
    <div className="App">
      <Virtualize
        style={{ width: "100%", height: "100%", backgroundColor: "#ccc" }}
        rows={100000}
        columns={10000}
        row={Row}
        column={Column}
        avgHeight={30}
        avgWidth={200}
      />
    </div>
  );
}

Live