Fixed React key warnings in Layout inspector

Summary: Fixed some React key warnings

Reviewed By: passy

Differential Revision: D18394993

fbshipit-source-id: 804b8e2cb8525253e2ef8120b621dcb98af0e3e5
This commit is contained in:
Michel Weststrate
2019-11-08 04:34:34 -08:00
committed by Facebook Github Bot
parent 0dd7c277d4
commit 9a8e267f2a
3 changed files with 19 additions and 5 deletions

View File

@@ -525,10 +525,12 @@ export default class DataInspector extends Component<DataInspectorProps> {
switch (metadata.status) {
case 'added':
propertyNodes.push(<Added>{dataInspectorNode}</Added>);
propertyNodes.push(<Added key={key}>{dataInspectorNode}</Added>);
break;
case 'removed':
propertyNodes.push(<Removed>{dataInspectorNode}</Removed>);
propertyNodes.push(
<Removed key={key}>{dataInspectorNode}</Removed>,
);
break;
default:
propertyNodes.push(dataInspectorNode);

View File

@@ -326,6 +326,7 @@ class ElementsRow extends PureComponent<ElementsRowProps, ElementsRowState> {
const attributes = element.attributes
? element.attributes.map(attr => (
<ElementsRowAttribute
key={attr.name}
name={attr.name}
value={attr.value}
matchingSearchQuery={matchingSearchQuery}