From 10b4b9505a51f8bf3fbc12d296a087b784a9201a Mon Sep 17 00:00:00 2001 From: Albert Sun Date: Wed, 5 Aug 2020 15:31:53 -0700 Subject: [PATCH] Make onEndReachedThreshold=null match default value if prop not provided 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 --- Libraries/Lists/VirtualizedList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 42935dabdac80f..ee07cf321a1dee 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1466,7 +1466,7 @@ class VirtualizedList extends React.PureComponent { const distanceFromEnd = contentLength - visibleLength - offset; const threshold = onEndReachedThreshold ? onEndReachedThreshold * visibleLength - : 0; + : 2; if ( onEndReached && this.state.last === getItemCount(data) - 1 &&