diff --git a/Libraries/Lists/FlatList.js b/Libraries/Lists/FlatList.js index f79b9cda8a844e..c00c0cef4c1b34 100644 --- a/Libraries/Lists/FlatList.js +++ b/Libraries/Lists/FlatList.js @@ -9,6 +9,7 @@ */ 'use strict'; +const Platform = require('Platform'); const deepDiffer = require('deepDiffer'); const React = require('React'); const View = require('View'); @@ -219,6 +220,12 @@ export type Props = RequiredProps & const defaultProps = { ...VirtualizedList.defaultProps, numColumns: 1, + /** + * Enabling this prop on Android greatly improves scrolling performance with no known issues. + * The alternative is that scrolling on Android is unusably bad. Enabling it on iOS has a few + * known issues. + */ + removeClippedSubviews: Platform.OS === 'android', }; export type DefaultProps = typeof defaultProps; diff --git a/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap b/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap index 7f523be29ac848..5b2c34d48d48a6 100644 --- a/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap +++ b/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap @@ -49,6 +49,7 @@ exports[`FlatList renders all the bells and whistles 1`] = ` /> } refreshing={false} + removeClippedSubviews={false} renderItem={[Function]} scrollEventThrottle={50} stickyHeaderIndices={Array []} @@ -143,6 +144,7 @@ exports[`FlatList renders empty list 1`] = ` onScroll={[Function]} onScrollBeginDrag={[Function]} onScrollEndDrag={[Function]} + removeClippedSubviews={false} renderItem={[Function]} scrollEventThrottle={50} stickyHeaderIndices={Array []} @@ -171,6 +173,7 @@ exports[`FlatList renders null list 1`] = ` onScroll={[Function]} onScrollBeginDrag={[Function]} onScrollEndDrag={[Function]} + removeClippedSubviews={false} renderItem={[Function]} scrollEventThrottle={50} stickyHeaderIndices={Array []} @@ -212,6 +215,7 @@ exports[`FlatList renders simple list 1`] = ` onScroll={[Function]} onScrollBeginDrag={[Function]} onScrollEndDrag={[Function]} + removeClippedSubviews={false} renderItem={[Function]} scrollEventThrottle={50} stickyHeaderIndices={Array []}