Skip to content

Commit d35383c

Browse files
Fix wrong variable in highlight callback cleanup
_setUpdateHighlightFor deletes from this._updateHighlightFor (a method) instead of this._updateHighlightMap (the actual map). This means highlight callbacks are never cleaned up when cells are removed, causing a memory leak. The $FlowFixMe annotation was masking the type error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8bac1df commit d35383c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/virtualized-lists/Lists/VirtualizedSectionList.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,7 @@ class VirtualizedSectionList<
433433
if (updateHighlightFn != null) {
434434
this._updateHighlightMap[cellKey] = updateHighlightFn;
435435
} else {
436-
// $FlowFixMe[prop-missing]
437-
delete this._updateHighlightFor[cellKey];
436+
delete this._updateHighlightMap[cellKey];
438437
}
439438
};
440439

0 commit comments

Comments
 (0)