apprev/components-jsx/runtime.ts
2025-05-16 06:16:52 -04:00

13 lines
349 B
TypeScript

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