Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
@types/react-virtualized
Advanced tools
@types/react-virtualized provides TypeScript definitions for the react-virtualized library, which is used for efficiently rendering large lists and tabular data by only rendering visible items.
List
The List component is used to render a large number of rows efficiently by only rendering the rows that are visible within the viewport.
import { List, ListRowRenderer } from 'react-virtualized';
const rowRenderer: ListRowRenderer = ({ index, key, style }) => (
<div key={key} style={style}>
Row {index}
</div>
);
const MyList = () => (
<List
width={300}
height={300}
rowCount={1000}
rowHeight={20}
rowRenderer={rowRenderer}
/>
);
Grid
The Grid component is used to render a large grid of items efficiently by only rendering the cells that are visible within the viewport.
import { Grid, GridCellRenderer } from 'react-virtualized';
const cellRenderer: GridCellRenderer = ({ columnIndex, key, rowIndex, style }) => (
<div key={key} style={style}>
Cell {rowIndex},{columnIndex}
</div>
);
const MyGrid = () => (
<Grid
columnCount={100}
columnWidth={100}
height={300}
rowCount={100}
rowHeight={30}
width={300}
cellRenderer={cellRenderer}
/>
);
Table
The Table component is used to render tabular data efficiently by only rendering the rows and columns that are visible within the viewport.
import { Column, Table } from 'react-virtualized';
const MyTable = () => (
<Table
width={300}
height={300}
headerHeight={20}
rowHeight={30}
rowCount={100}
rowGetter={({ index }) => ({ name: `Name ${index}`, age: index })}
>
<Column label='Name' dataKey='name' width={100} />
<Column label='Age' dataKey='age' width={100} />
</Table>
);
react-window is a lightweight alternative to react-virtualized for rendering large lists and grids efficiently. It offers a simpler API and better performance for most use cases.
react-infinite provides infinite scrolling capabilities for large lists. It is simpler than react-virtualized but does not offer as many features for grid and table rendering.
react-virtual is a modern, lightweight library for virtualizing large lists and tables. It offers a more modern API and better performance compared to react-virtualized.
npm install --save @types/react-virtualized
This package contains type definitions for react-virtualized (https://github.com/bvaughn/react-virtualized).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-virtualized.
These definitions were written by Kalle Ott, John Gunther, Konstantin Nesterov, Steve Zhang, Brandon Hall, Sebastian Busch, and Adam Zmenak.
FAQs
TypeScript definitions for react-virtualized
We found that @types/react-virtualized demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.