Skip to content

Commit

Permalink
Make onEndReachedThreshold=null match default value if prop not provided
Browse files Browse the repository at this point in the history
Summary:
This change makes the behavior of providing a null value to onEndReachedThreshold match the behavior of not providing the prop at all.

## Changelog:

[General] [Changed] - Adjusted VirtualizedList's onEndReachedThreshold default value when null is provided

Reviewed By: olegbl

Differential Revision: D22870445

fbshipit-source-id: 29cbf0550702244007689759846ae0356f06b48d
  • Loading branch information
fatalsun authored and facebook-github-bot committed Aug 5, 2020
1 parent 389b0b4 commit 10b4b95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
const distanceFromEnd = contentLength - visibleLength - offset;
const threshold = onEndReachedThreshold
? onEndReachedThreshold * visibleLength
: 0;
: 2;
if (
onEndReached &&
this.state.last === getItemCount(data) - 1 &&
Expand Down

0 comments on commit 10b4b95

Please sign in to comment.