-
Notifications
You must be signed in to change notification settings - Fork 262
Open
Description
While investigating some slow updates (repeatedly seeing old content as I scrolled -- more visible on Android but also happening pretty regularly on iOS) I noticed this line of code which appears to be doing nothing?
react-native-largelist/src/LargeList.js
Lines 453 to 458 in d93c898
const now = new Date().getTime(); | |
if (this._lastTick - now > 30) { | |
this._lastTick = now; | |
return; | |
} | |
this._lastTick = now; |
this._lastTick
will always be less than now
, so the early return will never be executed AFAICT. Diagnosing it with some console.logs showed this to be the case as well (the early return never executed).
I think this logic should be inverted as follows:
const now = new Date().getTime();
if (now - this._lastTick < 30) {
return;
}
this._lastTick = now;
this._shouldUpdateContent &&
this._groupRefs.forEach((group) =>
idx(() => group.current.contentConversion(offsetY))
);
And possibly it should be using the updateTimeInterval
prop which currently seems to be documented, but completely unused in the code (unless I missed something).
Metadata
Metadata
Assignees
Labels
No labels