Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Merge pull request #110 from madzhup/patch-1
Browse files Browse the repository at this point in the history
Check if node type is number and return it as string
  • Loading branch information
Muhammed Thanish committed Oct 19, 2016
2 parents 3edafe7 + a9fbc95 commit 2bd7776
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ function getData(element) {
return data;
}

if (typeof element === 'number') {
data.text = String.toString(element);
return data;
}

data.children = element.props.children;
const type = element.type;

Expand Down

0 comments on commit 2bd7776

Please sign in to comment.