@jay-js/system
Version:
A powerful and flexible TypeScript library for UI, state management, lazy loading, routing and managing draggable elements in modern web applications.
23 lines • 813 B
JavaScript
/**
* @file JSX Runtime implementation for Jay JS
* @description Provides the JSX transformation functions for production use
*/
import { Base, Fragment } from "../../core/index.js";
/**
* JSX transformation function for production use
*
* @param tag - String tag name or component function
* @param props - Element properties and attributes
* @returns HTMLElement or Promise<HTMLElement>
*/
function jsx(tag, props) {
if (typeof tag === "function") {
return tag(Object.assign({}, props));
}
// Use type assertion to get around type checking issues
// This is safe because base component expects tag to be a valid HTML tag
const element = Base(Object.assign({ tag }, props));
return element;
}
export { jsx, jsx as jsxs, Fragment };
//# sourceMappingURL=jsx-runtime.js.map