apprev/components-jsx/runtime.ts
2025-05-15 07:10:53 -04:00

11 lines
306 B
TypeScript

export const Fragment = Symbol("ComponentsJsx.Fragment");
export function createElement(type: typeof Fragment | ((props: any) => any), props: any, ...children: any[]) {
if (type === Fragment) {
return children;
}
props ??= {};
props.children = children;
return type(props);
}