mirror of https://github.com/docker/docs.git
Fix duplicate react key issue
Signed-off-by: Clement Ho <ClemMakesApps@gmail.com>
This commit is contained in:
parent
15035af444
commit
31358ef047
|
|
@ -36,9 +36,11 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
let logs = this.props.container.Logs ?
|
let logs = this.props.container.Logs ? this.props.container.Logs.map((l, index) => {
|
||||||
this.props.container.Logs.map((l) => <div key={l.substr(0,l.indexOf(' '))} dangerouslySetInnerHTML={{__html: convert.toHtml(escape(l.substr(l.indexOf(' ')+1)).replace(/ /g, ' <wbr>'))}}></div>) :
|
const key = `${this.props.container.Name}-${index}`;
|
||||||
['0 No logs for this container.'];
|
return <div key={key} dangerouslySetInnerHTML={{__html: convert.toHtml(escape(l.substr(l.indexOf(' ')+1)).replace(/ /g, ' <wbr>'))}}></div>;
|
||||||
|
}) : ['0 No logs for this container.'];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mini-logs wrapper">
|
<div className="mini-logs wrapper">
|
||||||
<div className="widget">
|
<div className="widget">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue