Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support platform customization of inverted VirtualizedList (#32038)
Summary: Pull Request resolved: #32038 This change slightly modifies VirtualizedList to better support platform customization of inverted behavior. For example, on react-native-windows, the transform approach to inverted breaks some scrolling input behaviors (see https://github.com/microsoft/react-native-windows/issue/4098). In react-native-windows, inverted behavior can be implemented using a combination of Yoga and platform native anchoring behaviors. When implemented this way, some assumptions in VirtualizedList are broken, namely that layouts of list items have monotonically increasing offsets on the scroll axis. Rather than entirely overhauling VirtualizedList to eliminate this assumption, a more trivial workaround is to invert the scroll and list item layout metrics in JS so they appear to be monotonically increasing for features like data loading and onEndReached events, and using raw metrics for features like scrollToIndex. We can accomplish most of this by overwriting the `_getScrollMetrics()` and `_getFrameMetrics()` functions in the platform VirtualizedList JS module. ## Changelog: [General][Added] - Support platform customization of inverted VirtualizedList Differential Revision: D30398027 fbshipit-source-id: 8ab3c2bdec29b7d9347fea1b89d034d1e7328393
- Loading branch information