Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/react-window

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-window

TypeScript definitions for react-window

  • 1.8.8
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @types/react-window?

The @types/react-window package provides TypeScript type definitions for react-window, a library that efficiently renders large lists and tabular data. It helps in enhancing performance by only rendering items that are currently visible within the viewport, thus reducing the amount of DOM nodes created at any given time. This package is essential for TypeScript developers using react-window to ensure type safety and to leverage IntelliSense in their IDE.

What are @types/react-window's main functionalities?

FixedSizeList

FixedSizeList is used for rendering large lists where each item has the same size. It requires specifying the height and width of the list container, the item count, and the item size.

import { FixedSizeList as List } from 'react-window';

function Row({ index, style }) {
  return <div style={style}>Row {index}</div>;
}

function Example() {
  return (
    <List
      height={150}
      itemCount={1000}
      itemSize={35}
      width={300}
    >
      {Row}
    </List>
  );
}

VariableSizeList

VariableSizeList is similar to FixedSizeList but allows for items of varying sizes. It requires a function `itemSize` that returns the size of an item given its index.

import { VariableSizeList as List } from 'react-window';

function Row({ index, style }) {
  return <div style={style}>Row {index}</div>;
}

function Example() {
  const getItemSize = index => (index % 2 === 0 ? 50 : 25);

  return (
    <List
      height={150}
      itemCount={1000}
      itemSize={getItemSize}
      width={300}
    >
      {Row}
    </List>
  );
}

Other packages similar to @types/react-window

FAQs

Package last updated on 07 Nov 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc