AddressBook: add missing key property to list items.

Well actually just remove the useless div, but the driver was
to add the missing key prop.
master
Tom Hacohen 5 years ago
parent effd74e0b2
commit 02ac73eb25

@ -50,6 +50,7 @@ function getContactColor(contact: ContactType) {
const AddressBookItem = React.memo((_props: any) => {
const {
style,
entry,
onClick,
} = _props;
@ -57,6 +58,7 @@ const AddressBookItem = React.memo((_props: any) => {
return (
<ListItem
style={style}
leftIcon={
<Avatar style={{ backgroundColor: getContactColor(entry) }}>
{name && name[0] && name[0].toUpperCase()}
@ -104,13 +106,12 @@ class AddressBook extends React.PureComponent<PropsType> {
rowHeight={56}
rowRenderer={({ index, key, style }) => {
return (
<div style={style}>
<AddressBookItem
key={key}
entry={entries[index]}
onClick={this.props.onItemClick}
/>
</div>
<AddressBookItem
key={key}
style={style}
entry={entries[index]}
onClick={this.props.onItemClick}
/>
);
}}
/>

Loading…
Cancel
Save