Browse files

Allow data lists to include 0 or '' (falsey items)

Fixing #13578

Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here:

Happy contributing!


(Write your motivation here.)

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Closes #15419

Reviewed By: sahrens

Differential Revision: D5795844

Pulled By: tomasreimers

fbshipit-source-id: 4cdf97a2f5e83e38f4e12af771b512e7dddd212a
  • Loading branch information...
tomasreimers authored and facebook-github-bot committed Sep 14, 2017
1 parent a177979 commit ae1a4f08f630168adb3070b6a6b168a8d534a3ee
Showing with 0 additions and 2 deletions.
  1. +0 −2 Libraries/Lists/VirtualizedList.js
@@ -527,7 +527,6 @@ class VirtualizedList extends React.PureComponent<Props, State> {
last = Math.min(end, last);
for (let ii = first; ii <= last; ii++) {
const item = getItem(data, ii);
invariant(item, 'No item for index ' + ii);
const key = keyExtractor(item, ii);
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
@@ -1168,7 +1167,6 @@ class VirtualizedList extends React.PureComponent<Props, State> {
_createViewToken = (index: number, isViewable: boolean) => {
const {data, getItem, keyExtractor} = this.props;
const item = getItem(data, index);
invariant(item, 'Missing item for index ' + index);
return {index, item, key: keyExtractor(item, index), isViewable};

0 comments on commit ae1a4f0

Please sign in to comment.