forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path@react-native+virtualized-lists+0.73.4+002+osr-improvement.patch
33 lines (32 loc) · 1.64 KB
/
@react-native+virtualized-lists+0.73.4+002+osr-improvement.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js b/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
index e338d90..70a59bf 100644
--- a/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
+++ b/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js
@@ -1219,7 +1219,7 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
zoomScale: 1,
};
_scrollRef: ?React.ElementRef<any> = null;
- _sentStartForContentLength = 0;
+ _sentStartForFirstVisibleItemKey: ?string = null;
_sentEndForContentLength = 0;
_updateCellsToRenderBatcher: Batchinator;
_viewabilityTuples: Array<ViewabilityHelperCallbackTuple> = [];
@@ -1550,16 +1550,16 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
onStartReached != null &&
this.state.cellsAroundViewport.first === 0 &&
isWithinStartThreshold &&
- this._listMetrics.getContentLength() !== this._sentStartForContentLength
+ this.state.firstVisibleItemKey !== this._sentStartForFirstVisibleItemKey
) {
- this._sentStartForContentLength = this._listMetrics.getContentLength();
+ this._sentStartForFirstVisibleItemKey = this.state.firstVisibleItemKey;
onStartReached({distanceFromStart});
}
// If the user scrolls away from the start or end and back again,
// cause onStartReached or onEndReached to be triggered again
if (!isWithinStartThreshold) {
- this._sentStartForContentLength = 0;
+ this._sentStartForFirstVisibleItemKey = null;
}
if (!isWithinEndThreshold) {
this._sentEndForContentLength = 0;