Skip to content

Commit

Permalink
Give key to React.Fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Mar 16, 2020
1 parent 103e929 commit 676f115
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { memo } from 'react';
import React, { memo, Fragment } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';

import { IndexDetails } from './index_details';
@@ -54,15 +54,10 @@ export const ProfileTree = memo(({ data, target, onHighlight }: Props) => {
<EuiSpacer size="s" />
<EuiFlexItem grow={false}>
{index.shards.map((shard, idx) => (
<>
<ShardDetails
key={shard.id[1] + `_${idx}`}
index={index}
shard={shard}
operations={shard[target]!}
/>
<Fragment key={shard.id[1] + `_${idx}`}>
<ShardDetails index={index} shard={shard} operations={shard[target]!} />
{idx < index.shards.length - 1 ? <EuiSpacer size="s" /> : undefined}
</>
</Fragment>
))}
</EuiFlexItem>
</EuiFlexGroup>

0 comments on commit 676f115

Please sign in to comment.