From 4158a007db5c744ebe01543a8ef39f0d9b3f43e7 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 22 Feb 2016 17:44:34 +0000 Subject: [PATCH] Give elements in search results a key ... to make react shut up about them --- src/HtmlUtils.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index fe97d7b84f..6db2b08fd1 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -146,19 +146,17 @@ class TextHighlighter extends BaseHighlighter { * returns a React node */ _processSnippet(snippet, highlight) { - var spanProps = { - key: this._key++, - }; + var key = this._key++; - if (highlight) { - spanProps.className = this.highlightClass; - } - - var node = { snippet }; + var node = + + { snippet } + ; if (highlight && this.highlightLink) { - node = {node} + node = {node} } + return node; } }