Socket
Socket
Sign inDemoInstall

@types/react-window

Package Overview
Dependencies
3
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/react-window

TypeScript definitions for react-window


Version published
Weekly downloads
1.2M
increased by5.15%
Maintainers
1
Install size
1.35 MB
Created
Weekly downloads
 

Package description

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

Readme

Source

Installation

npm install --save @types/react-window

Summary

This package contains type definitions for react-window (https://github.com/bvaughn/react-window/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-window.

Additional Details

  • Last updated: Tue, 27 Jul 2021 04:01:17 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Martynas Kadiša, Alex Guerra, and John Gozde.

FAQs

Last updated on 27 Jul 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc