DenReg/jsx-html/nodejs/jsx.js
Fabian Stamm 1b2d85eeef
All checks were successful
continuous-integration/drone/push Build is passing
Adding hotfixes for packages
2020-10-14 02:56:11 +02:00

19 lines
738 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Fragment = exports.jsx = void 0;
const ElementNode_1 = require("./node/ElementNode");
const ComponentNode_1 = require("./node/ComponentNode");
exports.jsx = (element, props, ...children) => {
const nodeProps = props || {};
if (typeof element === 'string') {
return new ElementNode_1.ElementNode(element, nodeProps, children);
}
if (typeof element === 'function') {
return new ComponentNode_1.ComponentNode(element, nodeProps, children);
}
throw new TypeError(`Expected jsx element to be a string or a function`);
};
exports.Fragment = (props, children) => {
return children;
};
//# sourceMappingURL=jsx.js.map