From d29d0a09e55cbf200f82d53c19924911425469ff Mon Sep 17 00:00:00 2001 From: Ali Abbas Malik Date: Thu, 15 Jul 2021 16:46:33 -0400 Subject: [PATCH] [ISSUE-4086] Added initial number in FlatList --- src/components/InvertedFlatList/index.android.js | 1 + src/components/InvertedFlatList/index.ios.js | 11 +++++++++-- src/components/InvertedFlatList/index.js | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/InvertedFlatList/index.android.js b/src/components/InvertedFlatList/index.android.js index 4ecfe10415bd..8f9062e570bf 100644 --- a/src/components/InvertedFlatList/index.android.js +++ b/src/components/InvertedFlatList/index.android.js @@ -6,6 +6,7 @@ export default forwardRef((props, ref) => ( // eslint-disable-next-line react/jsx-props-no-spreading {...props} ref={ref} + initialNumToRender={20} // Remove clipped subviews helps prevent avatars and attachments from eating up excess memory on Android. When // we run out of memory images stop appearing without any warning. diff --git a/src/components/InvertedFlatList/index.ios.js b/src/components/InvertedFlatList/index.ios.js index a98fa587721b..9a9ae537e0cd 100644 --- a/src/components/InvertedFlatList/index.ios.js +++ b/src/components/InvertedFlatList/index.ios.js @@ -1,4 +1,11 @@ +import React, {forwardRef} from 'react'; import BaseInvertedFlatList from './BaseInvertedFlatList'; -BaseInvertedFlatList.displayName = 'InvertedFlatList'; -export default BaseInvertedFlatList; +export default forwardRef((props, ref) => ( + +)); diff --git a/src/components/InvertedFlatList/index.js b/src/components/InvertedFlatList/index.js index a2dd20b2c999..3dab8062b6ac 100644 --- a/src/components/InvertedFlatList/index.js +++ b/src/components/InvertedFlatList/index.js @@ -61,6 +61,7 @@ class InvertedFlatList extends React.Component { {...this.props} ref={el => this.list = el} shouldMeasureItems + initialNumToRender={25} /> ); }