diff --git a/Libraries/Experimental/WindowedListView.js b/Libraries/Experimental/WindowedListView.js index 973b93f16..94b60b5a4 100644 --- a/Libraries/Experimental/WindowedListView.js +++ b/Libraries/Experimental/WindowedListView.js @@ -154,6 +154,11 @@ type Props = { * This determines how frequently events such as scroll and layout can trigger a re-render. */ recomputeRowsBatchingPeriod: number; + /** + * Called when rows will be mounted/unmounted. Mounted rows always form a contiguous block so it is expressed as a + * range of start plus count. + */ + onMountedRowsWillChange: (firstIdx: number, count: number) => void; }; const defaultProps = { enableDangerousRecycling: false, @@ -368,6 +373,7 @@ class WindowedListView extends React.Component { } } if (this.state.firstRow !== firstRow || this.state.lastRow !== lastRow) { + this.props.onMountedRowsWillChange && this.props.onMountedRowsWillChange(firstRow, lastRow - firstRow + 1); console.log('WLV: row render range changed:', {firstRow, lastRow}); } this.setState({firstRow, lastRow});