From c2ebc21eaa10c2f526ed6e9a772de45d322b4916 Mon Sep 17 00:00:00 2001 From: Nedunchezhiyan-M Date: Wed, 8 Apr 2026 23:21:05 +0530 Subject: [PATCH] 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. --- packages/virtualized-lists/Lists/VirtualizedSectionList.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/virtualized-lists/Lists/VirtualizedSectionList.js b/packages/virtualized-lists/Lists/VirtualizedSectionList.js index 55a63f8866ff..4eb0cbd07cf9 100644 --- a/packages/virtualized-lists/Lists/VirtualizedSectionList.js +++ b/packages/virtualized-lists/Lists/VirtualizedSectionList.js @@ -433,8 +433,7 @@ class VirtualizedSectionList< if (updateHighlightFn != null) { this._updateHighlightMap[cellKey] = updateHighlightFn; } else { - // $FlowFixMe[prop-missing] - delete this._updateHighlightFor[cellKey]; + delete this._updateHighlightMap[cellKey]; } };