From efe6a0f0b56191907e8f13be2aee28fe1dcdf555 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Wed, 17 Apr 2019 14:18:34 -0700 Subject: [PATCH] make sure onLayout calls _updateViewableItems immediately Summary: Makes sure `onViewableItemsChanged` fires ASAP when `waitForInterations` is false. This also works around another deeper bug where updates scheduled with `InteractionManager` aren't firing at all in some cases, and thus instead of just firing late, `onViewableItemsChanged` isn't firing until scroll which is not what we want with `waitForInterations: false`. That bug will require more digging. Differential Revision: D14984333 fbshipit-source-id: 718b39670307c6bc16268759bdb513682745265d --- Libraries/Lists/VirtualizedList.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index b64058851f9287..d3aef2528f60bc 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1097,6 +1097,7 @@ class VirtualizedList extends React.PureComponent { } this._computeBlankness(); + this._updateViewableItems(this.props.data); } _onCellUnmount = (cellKey: string) => {