New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@virtual-grid/react

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@virtual-grid/react

Simplified virtualization using [@tanstack/virtual](https://tanstack.com/virtual/v3)

2.0.3
latest
Source
npm
Version published
Weekly downloads
2.4K
29.01%
Maintainers
1
Weekly downloads
 
Created
Source

@virtual-grid/react

Simplified virtualization using @tanstack/virtual

Demo - Docs - Examples

Installation

npm install @virtual-grid/react

Usage

Example with the provided <Grid /> component:

import * as React from 'react';
import { Grid, useGrid } from '@virtual-grid/react';

const App = () => {
  const ref = React.useRef<HTMLDivElement>(null);

  const grid = useGrid({
    scrollRef: ref,
    count: 1000
    // ...
  });

  return (
    <div ref={ref} style={{ height: '400px', overflow: 'auto' }}>
      <Grid grid={grid}>{(i) => <div key={i}>...</div>}</Grid>
    </div>
  );
};

License

MIT

Keywords

react

FAQs

Package last updated on 28 May 2024

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