|
1 | 1 | // Third party dependencies.
|
2 | 2 | import React, { useCallback, useRef } from 'react';
|
3 |
| -import { Alert, ListRenderItem, View, ViewStyle } from 'react-native'; |
4 |
| -import { FlatList } from 'react-native-gesture-handler'; |
| 3 | +import { Alert, View, ViewStyle } from 'react-native'; |
5 | 4 | import { useSelector } from 'react-redux';
|
6 | 5 | import { useNavigation } from '@react-navigation/native';
|
7 | 6 | import { KeyringTypes } from '@metamask/keyring-controller';
|
@@ -31,6 +30,7 @@ import { Account, Assets } from '../../hooks/useAccounts';
|
31 | 30 | import Engine from '../../../core/Engine';
|
32 | 31 | import { removeAccountsFromPermissions } from '../../../core/Permissions';
|
33 | 32 | import Routes from '../../../constants/navigation/Routes';
|
| 33 | +import { FlashList, type ListRenderItem } from '@shopify/flash-list'; |
34 | 34 |
|
35 | 35 | // Internal dependencies.
|
36 | 36 | import { AccountSelectorListProps } from './AccountSelectorList.types';
|
@@ -299,14 +299,15 @@ const AccountSelectorList = ({
|
299 | 299 | }, [accounts, selectedAddresses, isAutoScrollEnabled]);
|
300 | 300 |
|
301 | 301 | return (
|
302 |
| - <FlatList |
| 302 | + <FlashList |
303 | 303 | ref={accountListRef}
|
304 | 304 | onContentSizeChange={onContentSizeChanged}
|
305 | 305 | data={accounts}
|
306 | 306 | keyExtractor={getKeyExtractor}
|
307 | 307 | renderItem={renderAccountItem}
|
| 308 | + estimatedItemSize={80} |
308 | 309 | // Increasing number of items at initial render fixes scroll issue.
|
309 |
| - initialNumToRender={999} |
| 310 | + // initialNumToRender={999} |
310 | 311 | {...props}
|
311 | 312 | />
|
312 | 313 | );
|
|
0 commit comments