Merge pull request #63 from omnikrll/editor-accessibility-unique-key-warning
add key property to lint message elements
This commit is contained in:
commit
563617d4e8
1 changed files with 7 additions and 7 deletions
|
@ -7,18 +7,18 @@ class EditorAccessibility extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
let messages = [];
|
let messages = [];
|
||||||
if (this.props.lintMessages.length > 0) {
|
if (this.props.lintMessages.length > 0) {
|
||||||
for (let i = 0; i < this.props.lintMessages.length; i++) {
|
this.props.lintMessages.forEach((lintMessage, i) => {
|
||||||
messages.push(
|
messages.push(
|
||||||
<li>
|
<li key={i}>
|
||||||
{this.props.lintMessages[i].severity} in line
|
{lintMessage.severity} in line
|
||||||
{this.props.lintMessages[i].line} :
|
{lintMessage.line} :
|
||||||
{this.props.lintMessages[i].message}
|
{lintMessage.message}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
} else {
|
} else {
|
||||||
messages.push(
|
messages.push(
|
||||||
<p tabIndex="0"> There are no lint messages </p>
|
<li tabIndex="0" key={0}> There are no lint messages </li>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue