mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
40aaeb7181
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46487 Changelog: [General][Fixed] Fixed accuracy of FlatList estimations to determine what elements are visible in the rendering window. This fixes a bug in FlatList where it thinks that some elements are visible in the rendering window, when they're not. Specifically, if a cell hasn't been laid out yet, it ignores all the information it already has on the ones that had, and estimates its position and offset based on the estimated size of the cells. In this case, if the first element has a larger offset because the list has a header, that offset is ignored in this case. One observed result of this is that in a list where there's a header and a single cell that occupy the whole rendering window, FlatList thinks it needs to pre-render an additional element because the header is ignored. Reviewed By: NickGerleman Differential Revision: D62649060 fbshipit-source-id: 437bae79916707ca1d08784190508a9f7e36688e
@react-native/virtualized-lists
Installation
yarn add @react-native/virtualized-lists
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the React Native root folder:
yarnto install the dependencies. You just need to run this onceyarn jest packages/virtualized-lists.