MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / Example

Function Example

src/routes/guides/examples/UsingAutoSizerWidthOnly.tsx:10–33  ·  view source on GitHub ↗
({
  rowCount,
  rowRenderer
}: {
  rowCount: number;
  rowRenderer: RowRenderer;
})

Source from the content-addressed store, hash-verified

8import { AutoSizer } from "react-virtualized-auto-sizer";
9
10function Example({
11 rowCount,
12 rowRenderer
13}: {
14 rowCount: number;
15 rowRenderer: RowRenderer;
16}) {
17 return (
18 <AutoSizer
19 renderProp={({ width }) =>
20 // Only the width is used; the list has a fixed height
21 width !== undefined ? (
22 <List
23 height={200}
24 rowCount={rowCount}
25 rowHeight={30}
26 rowRenderer={rowRenderer}
27 width={width}
28 />
29 ) : null
30 }
31 />
32 );
33}
34
35// <end>
36

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected