Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/flat list not calling render items for nullish values when numCol…
…umns > 1 (facebook#34205) Summary: Fixes facebook#34034. The FlatList doesn't call renderItem on nullish values when numColumns > 1, but it does when numColumns is not set (or equals 1). I think the behavior should be consistent, so I updated the code so renderItems is called for every items. I believe the condition `item != null` was here to make sure renderItem isn't called for index outside of data range, so I replaced it with `itemIndex < data.length`. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Fixed] - Fix FlatList not calling render items for nullish values when numColumns > 1 Pull Request resolved: facebook#34205 Test Plan: - I added a failing test corresponding to the issue, and the test now succeeds. - I used the same code as in the test on a newly initialized app on RN 0.69 and made sure renderItem was called for every items as expected. Reviewed By: NickGerleman Differential Revision: D38185103 Pulled By: lunaleaps fbshipit-source-id: 4baa55caef9574c91c43c047f9e419016ceb39db
- Loading branch information