Propagate onScroll
Reviewed By: yungsters Differential Revision: D4557672 fbshipit-source-id: a265231dbc992a84449e5ae051530f63f7b8efd4
This commit is contained in:
parent
c6c1c02b75
commit
7cfbb79617
|
@ -237,6 +237,10 @@ class VirtualizedList extends React.PureComponent {
|
||||||
|
|
||||||
constructor(props: Props) {
|
constructor(props: Props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
invariant(
|
||||||
|
!props.onScroll || !props.onScroll.__isNative,
|
||||||
|
'VirtualizedList does not support AnimatedEvent with onScroll and useNativeDriver',
|
||||||
|
);
|
||||||
this._updateCellsToRenderBatcher = new Batchinator(
|
this._updateCellsToRenderBatcher = new Batchinator(
|
||||||
this._updateCellsToRender,
|
this._updateCellsToRender,
|
||||||
this.props.updateCellsBatchingPeriod,
|
this.props.updateCellsBatchingPeriod,
|
||||||
|
@ -484,6 +488,9 @@ class VirtualizedList extends React.PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
_onScroll = (e: Object) => {
|
_onScroll = (e: Object) => {
|
||||||
|
if (this.props.onScroll) {
|
||||||
|
this.props.onScroll(e);
|
||||||
|
}
|
||||||
const timestamp = e.timeStamp;
|
const timestamp = e.timeStamp;
|
||||||
const visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement);
|
const visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement);
|
||||||
const contentLength = this._selectLength(e.nativeEvent.contentSize);
|
const contentLength = this._selectLength(e.nativeEvent.contentSize);
|
||||||
|
|
Loading…
Reference in New Issue