From bc2dbbb863f5eaec165af40df8ddffd81b0c4af0 Mon Sep 17 00:00:00 2001 From: Sam Chan Date: Wed, 9 Nov 2022 20:24:02 +0800 Subject: [PATCH] Fix VirtualizedList onViewableItemsChanged not triggered if first item in data evaluate to false #35280 --- Libraries/Lists/VirtualizedList.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 4e46e1458c3f79..ee141b4fdec90d 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1749,7 +1749,8 @@ export default class VirtualizedList extends StateSafePureComponent< 'Tried to get frame for out of range index ' + index, ); const item = getItem(data, index); - const frame = item && this._frames[this._keyExtractor(item, index, props)]; + const frame = + item != null && this._frames[this._keyExtractor(item, index, props)]; if (!frame || frame.index !== index) { if (getItemLayout) { /* $FlowFixMe[prop-missing] (>=0.63.0 site=react_native_fb) This comment