Created
December 17, 2018 11:27
-
-
Save rajeshpillai/2529076dd958d75f77480e8909f01ebf to your computer and use it in GitHub Desktop.
Revisions
-
rajeshpillai created this gist
Dec 17, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ const TinyReact = (function () { function createElement(type, attributes = {}, ...children) { const childElements = [].concat(...children).map( child => child instanceof Object ? child : createElement("text", { textContent: child }) ); return { type, children: childElements, props: Object.assign({ children: childElements }, attributes) } } return { createElement } }());