From 7cfbb79617e7455fc2c9d1fb2e179b3d5844880b Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Tue, 14 Feb 2017 18:24:20 -0800 Subject: [PATCH] Propagate onScroll Reviewed By: yungsters Differential Revision: D4557672 fbshipit-source-id: a265231dbc992a84449e5ae051530f63f7b8efd4 --- Libraries/Experimental/VirtualizedList.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Libraries/Experimental/VirtualizedList.js b/Libraries/Experimental/VirtualizedList.js index 6659e383d..8d90c286e 100644 --- a/Libraries/Experimental/VirtualizedList.js +++ b/Libraries/Experimental/VirtualizedList.js @@ -237,6 +237,10 @@ class VirtualizedList extends React.PureComponent { constructor(props: Props) { super(props); + invariant( + !props.onScroll || !props.onScroll.__isNative, + 'VirtualizedList does not support AnimatedEvent with onScroll and useNativeDriver', + ); this._updateCellsToRenderBatcher = new Batchinator( this._updateCellsToRender, this.props.updateCellsBatchingPeriod, @@ -484,6 +488,9 @@ class VirtualizedList extends React.PureComponent { }; _onScroll = (e: Object) => { + if (this.props.onScroll) { + this.props.onScroll(e); + } const timestamp = e.timeStamp; const visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement); const contentLength = this._selectLength(e.nativeEvent.contentSize);