@react-native/virtualized-lists 0.73.3 → 0.73.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Lists/VirtualizedList.js +2 -14
- package/package.json +1 -1
package/Lists/VirtualizedList.js
CHANGED
|
@@ -91,19 +91,6 @@ type State = {
|
|
|
91
91
|
pendingScrollUpdateCount: number,
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
function findLastWhere<T>(
|
|
95
|
-
arr: $ReadOnlyArray<T>,
|
|
96
|
-
predicate: (element: T) => boolean,
|
|
97
|
-
): T | null {
|
|
98
|
-
for (let i = arr.length - 1; i >= 0; i--) {
|
|
99
|
-
if (predicate(arr[i])) {
|
|
100
|
-
return arr[i];
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
94
|
function getScrollingThreshold(threshold: number, visibleLength: number) {
|
|
108
95
|
return (threshold * visibleLength) / 2;
|
|
109
96
|
}
|
|
@@ -986,7 +973,8 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
|
|
|
986
973
|
const spacerKey = this._getSpacerKey(!horizontal);
|
|
987
974
|
|
|
988
975
|
const renderRegions = this.state.renderMask.enumerateRegions();
|
|
989
|
-
const
|
|
976
|
+
const lastRegion = renderRegions[renderRegions.length - 1];
|
|
977
|
+
const lastSpacer = lastRegion?.isSpacer ? lastRegion : null;
|
|
990
978
|
|
|
991
979
|
for (const section of renderRegions) {
|
|
992
980
|
if (section.isSpacer) {
|