From bac41aa5273dc853a980d2a551824dce25ea671f Mon Sep 17 00:00:00 2001 From: Lucjan Suski Date: Fri, 21 Apr 2017 14:16:53 +0200 Subject: [PATCH] Handle null elements in getData Null is valid element in React, so let's handle it and return no data in this case. --- packages/addon-info/src/components/Node.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/addon-info/src/components/Node.js b/packages/addon-info/src/components/Node.js index c2892317fba7..77b8e0f62041 100644 --- a/packages/addon-info/src/components/Node.js +++ b/packages/addon-info/src/components/Node.js @@ -70,6 +70,10 @@ function getData(element) { text: null, children: null, }; + + if (typeof element === 'null') { + return data + } if (typeof element == 'string') { data.text = element;