Skip to content

Commit 9f6ed24

Browse files
author
Clauderic Demers
committed
Renamed onRowsRendered to onItemsRendered
1 parent 781d1af commit 9f6ed24

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ render(
8282
| scrollToAlignment | String | | Used in combination with `scrollToIndex`, this prop controls the alignment of the scrolled to item. One of: `'start'`, `'center'`, `'end'` or `'auto'`. Use `'start'` to always align items to the top of the container and `'end'` to align them bottom. Use `'center`' to align them in the middle of the container. `'auto'` scrolls the least amount possible to ensure that the specified `scrollToIndex` item is fully visible. |
8383
| overscanCount | Number | | Number of extra buffer items to render above/below the visible items. Tweaking this can help reduce scroll flickering on certain browsers/devices. |
8484
| estimatedItemSize | Number | | Used to estimate the total size of the list before all of its items have actually been measured. The estimated total height is progressively adjusted as items are rendered. |
85-
| onRowsRendered | Function | | Callback invoked with information about the slice of rows that were just rendered. It has the following signature: `({startIndex: number, stopIndex: number})`. |
85+
| onItemsRendered | Function | | Callback invoked with information about the slice of rows/columns that were just rendered. It has the following signature: `({startIndex: number, stopIndex: number})`. |
8686
| onScroll | Function | | Callback invoked whenever the scroll offset changes within the inner scrollable region. It has the following signature: `(scrollTop: number, event: React.UIEvent<HTMLDivElement>)`. |
8787

8888
*\* Width may only be a string when `scrollDirection` is `'vertical'`. Similarly, Height may only be a string if `scrollDirection` is `'horizontal'`*

src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface Props {
7272
scrollDirection?: DIRECTION,
7373
style?: any,
7474
width?: number | string,
75-
onRowsRendered?({startIndex, stopIndex}: RenderedRows): void,
75+
onItemsRendered?({startIndex, stopIndex}: RenderedRows): void,
7676
onScroll?(offset: number, event: React.UIEvent<HTMLDivElement>): void,
7777
renderItem(itemInfo: ItemInfo): React.ReactNode,
7878
}
@@ -94,7 +94,7 @@ export default class VirtualList extends React.PureComponent<Props, State> {
9494
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
9595
itemCount: PropTypes.number.isRequired,
9696
itemSize: PropTypes.oneOfType([PropTypes.number, PropTypes.array, PropTypes.func]).isRequired,
97-
onRowsRendered: PropTypes.func,
97+
onItemsRendered: PropTypes.func,
9898
overscanCount: PropTypes.number,
9999
renderItem: PropTypes.func.isRequired,
100100
scrollOffset: PropTypes.number,
@@ -275,7 +275,7 @@ export default class VirtualList extends React.PureComponent<Props, State> {
275275
renderItem,
276276
itemCount,
277277
itemSize,
278-
onRowsRendered,
278+
onItemsRendered,
279279
onScroll,
280280
scrollDirection = DIRECTION_VERTICAL,
281281
scrollOffset,
@@ -301,8 +301,8 @@ export default class VirtualList extends React.PureComponent<Props, State> {
301301
}));
302302
}
303303

304-
if (typeof onRowsRendered === 'function') {
305-
onRowsRendered({
304+
if (typeof onItemsRendered === 'function') {
305+
onItemsRendered({
306306
startIndex: start,
307307
stopIndex: stop,
308308
});

0 commit comments

Comments
 (0)