From c604a4f0bf1c6762bdda12c43859267fe76978b1 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Tue, 27 Jun 2023 16:05:41 +0500 Subject: [PATCH 1/2] fix: use correct prop type in BaseInvertedFlatlist component --- src/components/InvertedFlatList/BaseInvertedFlatList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/InvertedFlatList/BaseInvertedFlatList.js b/src/components/InvertedFlatList/BaseInvertedFlatList.js index 6c507d110436..4eb29af89cb3 100644 --- a/src/components/InvertedFlatList/BaseInvertedFlatList.js +++ b/src/components/InvertedFlatList/BaseInvertedFlatList.js @@ -18,7 +18,7 @@ const propTypes = { initialRowHeight: PropTypes.number.isRequired, /** Passed via forwardRef so we can access the FlatList ref */ - innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(FlatList)})]).isRequired, + innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(React.Component)})]).isRequired, /** Should we measure these items and call getItemLayout? */ shouldMeasureItems: PropTypes.bool, From 6893686c83883b4f16675279010ded291f81ebcf Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Wed, 28 Jun 2023 06:47:33 +0500 Subject: [PATCH 2/2] fix: use native flatlist for type in BaseInvertedFlatList --- src/components/InvertedFlatList/BaseInvertedFlatList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/InvertedFlatList/BaseInvertedFlatList.js b/src/components/InvertedFlatList/BaseInvertedFlatList.js index 4eb29af89cb3..d3fcda0ea5fd 100644 --- a/src/components/InvertedFlatList/BaseInvertedFlatList.js +++ b/src/components/InvertedFlatList/BaseInvertedFlatList.js @@ -2,7 +2,7 @@ import _ from 'underscore'; import React, {forwardRef, Component} from 'react'; import PropTypes from 'prop-types'; -import {View} from 'react-native'; +import {View, FlatList as NativeFlatlist} from 'react-native'; import * as CollectionUtils from '../../libs/CollectionUtils'; import FlatList from '../FlatList'; @@ -18,7 +18,7 @@ const propTypes = { initialRowHeight: PropTypes.number.isRequired, /** Passed via forwardRef so we can access the FlatList ref */ - innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(React.Component)})]).isRequired, + innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({current: PropTypes.instanceOf(NativeFlatlist)})]).isRequired, /** Should we measure these items and call getItemLayout? */ shouldMeasureItems: PropTypes.bool,