Skip to content

Commit 752034d

Browse files
Fix typo in VirtualizedSectionList._setUpdateHighlightFor deleting from method instead of map
The else branch of _setUpdateHighlightFor was calling: delete this._updateHighlightFor[cellKey] which targeted the arrow-function method itself rather than the _updateHighlightMap backing store. This meant item highlight callbacks were never cleaned up on unmount, causing a memory leak and stale callbacks. Fix: replace with delete this._updateHighlightMap[cellKey] to match the symmetric _setUpdatePropsFor implementation. The // \[prop-missing] suppression comment is also removed since the correct target no longer triggers a Flow error.
1 parent 800f350 commit 752034d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎packages/virtualized-lists/Lists/VirtualizedSectionList.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,7 @@ class VirtualizedSectionList<
431431
if (updateHighlightFn != null) {
432432
this._updateHighlightMap[cellKey] = updateHighlightFn;
433433
} else {
434-
// $FlowFixMe[prop-missing]
435-
delete this._updateHighlightFor[cellKey];
434+
delete this._updateHighlightMap[cellKey];
436435
}
437436
};
438437

0 commit comments

Comments
 (0)