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

Function Example

lib/virtualization.test.tsx:204–216  ·  view source on GitHub ↗
({ data }: { data: string[] })

Source from the content-addressed store, hash-verified

202 return <div style={style}>{data[index]}</div>;
203 }
204 function Example({ data }: { data: string[] }) {
205 rowHeight = useDynamicRowHeight({ defaultRowHeight: 50 });
206 return (
207 <List
208 rowComponent={Row}
209 rowProps={{ data }}
210 rowCount={2}
211 rowHeight={rowHeight}
212 rowKey={rowKey}
213 style={{ height: 100 }}
214 />
215 );
216 }
217 const { container, rerender } = render(<Example data={["a", "b"]} />);
218 rerender(<Example data={["b", "a"]} />);
219 const firstRow = container.firstElementChild!

Callers

nothing calls this directly

Calls 1

useDynamicRowHeightFunction · 0.90

Tested by

no test coverage detected