jsx-dev-runtime.js 444 B

123456789101112131415161718
  1. // src/jsx/jsx-dev-runtime.ts
  2. import { jsxFn } from "./base.js";
  3. import { Fragment } from "./base.js";
  4. function jsxDEV(tag, props, key) {
  5. let node;
  6. if (!props || !("children" in props)) {
  7. node = jsxFn(tag, props, []);
  8. } else {
  9. const children = props.children;
  10. node = Array.isArray(children) ? jsxFn(tag, props, children) : jsxFn(tag, props, [children]);
  11. }
  12. node.key = key;
  13. return node;
  14. }
  15. export {
  16. Fragment,
  17. jsxDEV
  18. };