Skip to content

Commit

Permalink
Propagate onScroll
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D4557672

fbshipit-source-id: a265231dbc992a84449e5ae051530f63f7b8efd4
  • Loading branch information
sahrens authored and facebook-github-bot committed Feb 15, 2017
1 parent c6c1c02 commit 7cfbb79
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Libraries/Experimental/VirtualizedList.js
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7cfbb79

Please sign in to comment.