From 718b6b73caca6fd3716d1f35b6ee6caa6fc6eb33 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Wed, 7 Aug 2019 12:23:43 +0200 Subject: [PATCH 1/2] Update VirtualizedList.js --- 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 939aceee6ff2f7..ad732d34913b1c 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -326,7 +326,7 @@ class VirtualizedList extends React.PureComponent { const {animated, index, viewOffset, viewPosition} = params; invariant( index >= 0 && index < getItemCount(data), - `scrollToIndex out of range: ${index} vs ${getItemCount(data) - 1}`, + `scrollToIndex out of range: requested index ${index} but maximum is ${getItemCount(data) - 1}`, ); if (!getItemLayout && index > this._highestMeasuredFrameIndex) { invariant( From bcdbc8c611c33da2086c332f86bf9d24841786e2 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Wed, 7 Aug 2019 15:27:22 +0200 Subject: [PATCH 2/2] fix prettier --- Libraries/Lists/VirtualizedList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index ad732d34913b1c..b3e81c05c97ddb 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -326,7 +326,9 @@ class VirtualizedList extends React.PureComponent { const {animated, index, viewOffset, viewPosition} = params; invariant( index >= 0 && index < getItemCount(data), - `scrollToIndex out of range: requested index ${index} but maximum is ${getItemCount(data) - 1}`, + `scrollToIndex out of range: requested index ${index} but maximum is ${getItemCount( + data, + ) - 1}`, ); if (!getItemLayout && index > this._highestMeasuredFrameIndex) { invariant(