Fixed key warning

This commit is contained in:
Jori Lallo
2017-05-13 16:03:35 -07:00
parent 3ecca38d9e
commit 7144cc7f14

View File

@@ -150,10 +150,14 @@ class DocumentScene extends React.Component {
const { document, pathToDocument } = this.store;
if (document && document.collection) {
const titleSections = pathToDocument
? pathToDocument.map(node => <Link to={node.url}>{node.title}</Link>)
? pathToDocument.map(node => (
<Link key={node.id} to={node.url}>{node.title}</Link>
))
: [];
titleSections.unshift(
<Link to={document.collection.url}>{document.collection.name}</Link>
<Link key={document.collection.id} to={document.collection.url}>
{document.collection.name}
</Link>
);
return (