Rework scroll management
Reviewed By: devknoll Differential Revision: D3138464 fb-gh-sync-id: fd1bb7f623c689836ae52ea8bf384d8efccddfea fbshipit-source-id: fd1bb7f623c689836ae52ea8bf384d8efccddfea
This commit is contained in:
parent
41576eaa56
commit
06b2998de8
|
@ -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});
|
||||
|
|
Loading…
Reference in New Issue