Skip to content

Commit

Permalink
Remove the FlashList & Ref, just use FlatList. also I need to fix my …
Browse files Browse the repository at this point in the history
…emulator
  • Loading branch information
thienlnam committed Apr 18, 2024
1 parent 97256fb commit 65da8af
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/pages/settings/Wallet/PaymentMethodList.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {FlashList} from '@shopify/flash-list';
import lodashSortBy from 'lodash/sortBy';
import type {ReactElement, Ref} from 'react';
import React, {useCallback, useMemo, useRef} from 'react';
import React, {useCallback, useMemo} from 'react';
import type {GestureResponderEvent, StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import {FlatList, View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import type {SvgProps} from 'react-native-svg/lib/typescript/ReactNativeSVG';
Expand Down Expand Up @@ -192,7 +191,6 @@ function PaymentMethodList({
const StyleUtils = useStyleUtils();
const {translate} = useLocalize();
const {isOffline} = useNetwork();
const flashListRef = useRef<FlashList<PaymentMethodItem>>(null);

const filteredPaymentMethods = useMemo(() => {
if (shouldShowAssignedCards) {
Expand Down Expand Up @@ -337,9 +335,7 @@ function PaymentMethodList({
return (
<>
<View style={[style, {minHeight: (filteredPaymentMethods.length + (shouldShowAddBankAccount ? 1 : 0)) * variables.optionRowHeight}]}>
<FlashList
ref={flashListRef}
estimatedItemSize={variables.optionRowHeight}
<FlatList
data={filteredPaymentMethods}
renderItem={renderItem}
keyExtractor={keyExtractor}
Expand Down

0 comments on commit 65da8af

Please sign in to comment.