diff options
author | Florian Dold <florian.dold@gmail.com> | 2015-12-20 20:34:20 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2015-12-20 20:34:20 +0100 |
commit | 604cb2f80473c23f76afd37670a1a7249ae170a3 (patch) | |
tree | 12783d32e3a1cc17a113db4c8a9e1ff66a69414e /extension/lib/polyfill-react.js | |
parent | 8e80bbbbb8489532e1f2a5c9b632e5ead4a6ec68 (diff) |
Missing files, payment
Diffstat (limited to 'extension/lib/polyfill-react.js')
-rw-r--r-- | extension/lib/polyfill-react.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/extension/lib/polyfill-react.js b/extension/lib/polyfill-react.js new file mode 100644 index 000000000..f30ba7c64 --- /dev/null +++ b/extension/lib/polyfill-react.js @@ -0,0 +1,16 @@ +"use strict"; +let React = { + createElement: function (tag, props, ...children) { + let e = document.createElement(tag); + for (let k in props) { + e.setAttribute(k, props[k]); + } + for (let child of children) { + if ("string" === typeof child || "number" == typeof child) { + child = document.createTextNode(child); + } + e.appendChild(child); + } + return e; + } +}; |