From 752034dfef0a73fa9f3483346dbd24bf678e5027 Mon Sep 17 00:00:00 2001 From: Divya1024 Date: Sat, 24 Oct 2026 22:51:49 +0530 Subject: [PATCH] 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. --- 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 41bfc0c8888e..af489e53da36 100644 --- a/packages/virtualized-lists/Lists/VirtualizedSectionList.js +++ b/packages/virtualized-lists/Lists/VirtualizedSectionList.js @@ -431,8 +431,7 @@ class VirtualizedSectionList< if (updateHighlightFn != null) { this._updateHighlightMap[cellKey] = updateHighlightFn; } else { - // $FlowFixMe[prop-missing] - delete this._updateHighlightFor[cellKey]; + delete this._updateHighlightMap[cellKey]; } };