From 81b2ffe7df381deb0f9f860eff59b02ceb56a1f5 Mon Sep 17 00:00:00 2001 From: iwater Date: Tue, 25 Jul 2017 23:42:51 +0800 Subject: [PATCH] fix too many unused render with HeaderComponent --- Libraries/Lists/VirtualizedList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 0638a6b208870a..bd2f8f386e2642 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -977,7 +977,7 @@ class VirtualizedList extends React.PureComponent { const itemCount = this.props.getItemCount(this.props.data); let hiPri = false; if (first > 0 || last < itemCount - 1) { - const distTop = offset - this._getFrameMetricsApprox(first).offset; + const distTop = offset - (this._getFrameMetricsApprox(first).offset - this._getFrameMetricsApprox(0).offset); const distBottom = this._getFrameMetricsApprox(last).offset - (offset + visibleLength); const scrollingThreshold =