Comparing version 2.0.2 to 3.0.0
@@ -51,4 +51,6 @@ 'use strict'; | ||
} else if (isFunction( tag )) { | ||
var props = Object.assign({}, attr, { children: children }); | ||
return tag( props ); | ||
// Custom elements. | ||
var node$1 = new tag(); | ||
attributes(attr, node$1); | ||
return node$1; | ||
} | ||
@@ -55,0 +57,0 @@ } |
@@ -47,4 +47,6 @@ function isElement(val) { | ||
} else if (isFunction( tag )) { | ||
var props = Object.assign({}, attr, { children: children }); | ||
return tag( props ); | ||
// Custom elements. | ||
var node$1 = new tag(); | ||
attributes(attr, node$1); | ||
return node$1; | ||
} | ||
@@ -51,0 +53,0 @@ } |
declare module "jsx-dom" { | ||
function createElement( | ||
type: string, | ||
type: string | Function, | ||
props?: any, | ||
@@ -5,0 +5,0 @@ ...children: (Node|string)[] |
{ | ||
"name": "jsx-dom", | ||
"version": "2.0.2", | ||
"description": "JSX to document.createElement.", | ||
"version": "3.0.0", | ||
"description": "JSX to document.createElement", | ||
"main": "dist/index.cjs.js", | ||
@@ -6,0 +6,0 @@ "jsnext:main": "dist/index.es.js", |
@@ -38,4 +38,5 @@ # jsx-dom | ||
6. `innerHTML`, `innerText` and `textContent` are accepted. | ||
7. Uppercase tag names are treated as a **Custom Element** and will be initialized with a `new` call. | ||
## Browser Support | ||
`jsx-dom` requires `Object.keys` and `Object.assign` (an ES6 feature). If you are using Babel, the [`transform-object-assign`](https://babeljs.io/docs/plugins/transform-object-assign/#usage) plugin should eliminate the need for a polyfill. |
@@ -28,4 +28,6 @@ import { | ||
} else if (isFunction( tag )) { | ||
const props = Object.assign({}, attr, { children }); | ||
return tag( props ); | ||
// Custom elements. | ||
const node = new tag(); | ||
attributes(attr, node); | ||
return node; | ||
} | ||
@@ -32,0 +34,0 @@ } |
10992
338
41