import { FixedSizeList, VariableSizeList, FixedSizeGrid, VariableSizeGrid } from "react-window"; import * as React from "react"; const FixedSizeListTestRequiredProps: React.SFC = () => ( {({ style, index }) =>
Test {index}
}
); const VariableSizeListTestRequiredProps: React.SFC = () => ( 0} height={0} itemCount={0} width={0}> {({ style, index }) =>
Test {index}
}
); const FixedSizeGridTestRequiredProps: React.SFC = () => ( {({ style, columnIndex, rowIndex }) => (
Test {rowIndex} {columnIndex}
)}
); const VariableSizeGridTestRequiredProps: React.SFC = () => ( 0} rowCount={0} rowHeight={index => 0} height={0} width={0} > {({ style, columnIndex, rowIndex }) => (
Test {rowIndex} {columnIndex}
)}
); const anyRef: React.Ref = React.createRef(); const FixedSizeListTestOptionalProps: React.SFC<{ testBool: boolean }> = ({ testBool }) => ( "foo" + index.toString()} onItemsRendered={({ overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex }) => overscanStartIndex + overscanStopIndex + visibleStartIndex + visibleStopIndex } useIsScrolling={true} outerTagName="div" style={{ color: "cyan" }} overscanCount={0} outerRef={anyRef} ref="ref" onScroll={({ scrollDirection, scrollOffset, scrollUpdateWasRequested }) => scrollDirection === "forward" ? scrollUpdateWasRequested : scrollOffset } > {({ style, index }) =>
Test {index}
}
); const VariableSizeListTestOptionalProps: React.SFC<{ testBool: boolean }> = ({ testBool }) => ( 0} height={0} itemCount={0} width={0} className="" direction={testBool ? "vertical" : "horizontal"} initialScrollOffset={0} innerRef={anyRef} innerTagName="div" itemData={{ foo: "bar" }} itemKey={index => "foo" + index.toString()} onItemsRendered={({ overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex }) => overscanStartIndex + overscanStopIndex + visibleStartIndex + visibleStopIndex } useIsScrolling={true} outerTagName="div" style={{ color: "cyan" }} overscanCount={0} outerRef={anyRef} ref="ref" onScroll={({ scrollDirection, scrollOffset, scrollUpdateWasRequested }) => scrollDirection === "forward" ? scrollUpdateWasRequested : scrollOffset } estimatedItemSize={0} > {({ style, index }) =>
Test {index}
}
); const VariableSizeGridTestOptionalProps: React.SFC = () => ( 0} rowCount={0} rowHeight={index => 0} height={0} width={0} className="" estimatedColumnWidth={0} estimatedRowHeight={0} initialScrollLeft={0} initialScrollTop={0} innerRef={anyRef} innerTagName="div" itemData={{ foo: "bar" }} itemKey={({ columnIndex, rowIndex }) => columnIndex.toString() + rowIndex.toString() } onItemsRendered={({ overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex }) => undefined} onScroll={({ horizontalScrollDirection, scrollLeft, scrollTop, scrollUpdateWasRequested, verticalScrollDirection }) => undefined} outerRef={anyRef} outerTagName="div" overscanCount={5} ref="ref" style={{ color: "red" }} useIsScrolling={true} > {({ style, columnIndex, rowIndex }) => (
Test {rowIndex} {columnIndex}
)}
);