fix key props related issues

This commit is contained in:
feruz 2019-12-23 09:34:11 +02:00
parent 983079f1e3
commit 1512e81add
3 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,5 @@
import React from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import { FormattedRelativeTime } from 'react-intl';
import { UserAvatar } from '../../../userAvatar';
import styles from './userListItemStyles';

View File

@ -48,12 +48,12 @@ const TransactionView = ({ transactions, type, refreshing, setRefreshing, isLoad
Object.keys(item).length > 0 &&
item.value.indexOf(transaction_types[type]) > -1 && (
<CollapsibleCard
key={item.created.toString()}
key={`keyh-${item.created.toString()}`}
noBorder
noContainer
titleComponent={
<WalletLineItem
key={item.created.toString()}
key={`keyt-${item.created.toString()}`}
index={index + 1}
text={intl.formatMessage({
id: `wallet.${get(item, 'textKey')}`,
@ -71,7 +71,7 @@ const TransactionView = ({ transactions, type, refreshing, setRefreshing, isLoad
>
{(get(item, 'details') || get(item, 'memo')) && (
<WalletLineItem
key={index.toString()}
key={`keyd-${item.created.toString()}`}
text={get(item, 'details', '')}
isBlackText
isThin
@ -92,6 +92,7 @@ const TransactionView = ({ transactions, type, refreshing, setRefreshing, isLoad
onRefresh={refreshControl}
refreshing={refreshing}
renderItem={({ item, index }) => _renderItem(item, index)}
keyExtractor={(item, index) => index.toString()}
/>
</View>
);

View File

@ -54,9 +54,9 @@ const WalletHeaderView = ({
}
}, [reload]);
const _getBalanceItem = (balance, options, key) =>
const _getBalanceItem = (balance, options, _key) =>
balance !== undefined && (
<View style={styles.balanceWrapper}>
<View style={styles.balanceWrapper} key={balance + _key}>
<Text style={styles.balanceText}>{balance}</Text>
<DropdownButton
dropdownRowWrapper={styles.dropdownRowStyle}
@ -71,7 +71,7 @@ const WalletHeaderView = ({
dropdownStyle={styles.dropdownStyle}
iconStyle={styles.dropdownIconStyle}
/>
<Text style={styles.subText}>{intl.formatMessage({ id: `wallet.${key}.title` })}</Text>
<Text style={styles.subText}>{intl.formatMessage({ id: `wallet.${_key}.title` })}</Text>
</View>
);
@ -106,8 +106,9 @@ const WalletHeaderView = ({
)}
{valueDescriptions &&
valueDescriptions.map(item => (
valueDescriptions.map((item, _index) => (
<WalletLineItem
key={`keyl-${_index.toString()}`}
fitContent
style={styles.valueDescriptions}
text={intl.formatMessage({ id: `wallet.${get(item, 'textKey')}` })}