Skip to content

Commit 4d308d0

Browse files
committed
Add keys for error/warn messages
1 parent 3fa28c0 commit 4d308d0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementErrorsAndWarningsTree.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,22 @@ function InnerErrorsAndWarningsTreeView({
9191
errors,
9292
warnings,
9393
}: InnerErrorsAndWarningsTreeViewProps) {
94-
// TODO (inline errors) keys for each message
9594
return (
9695
<React.Fragment>
97-
{errors.map(error => {
96+
{errors.map((error, index) => {
9897
return (
9998
<ErrorOrWarningView
99+
key={`error-${index}`}
100100
className={styles.Error}
101101
errorOrWarning={error}
102102
icon={<Icon className={styles.ErrorIcon} type="error" />}
103103
/>
104104
);
105105
})}
106-
{warnings.map(warning => {
106+
{warnings.map((warning, index) => {
107107
return (
108108
<ErrorOrWarningView
109+
key={`warning-${index}`}
109110
className={styles.Warning}
110111
errorOrWarning={warning}
111112
icon={<Icon className={styles.WarningIcon} type="warning" />}

0 commit comments

Comments
 (0)