Skip to main content
Go to Latest
File
// deno-lint-ignore-file no-explicit-anyimport { streamComponent } from "./_internal/stream_component.ts";import { streamElement } from "./_internal/stream_element.ts";import { streamFragment } from "./_internal/stream_fragment.ts";import { streamUnknown } from "./_internal/stream_unknown.ts";import { isValidTag } from "./_internal/util.ts";import type { Promisable, StreamableNode } from "./types.ts";
// IMPORTANT: This is UNSAFE experimental code, do not use in production.
export function jsx(type: any, props: any): Promisable<StreamableNode> { // console.group(type, props);
try { if (typeof type === "function") { return streamComponent(type, props); } else if (type === null) { return streamFragment(props.children); } else if (isValidTag(type)) { return streamElement(type, props); } else { return streamUnknown(type); } } finally { // console.groupEnd(); }}
export const jsxs = jsx;export const jsxDEV = jsx;export const Fragment = null;
// deno-lint-ignore no-namespaceexport namespace JSX { export type Element = Promisable<StreamableNode>;
export interface IntrinsicAttributes { key?: any; }
export interface IntrinsicElements { [name: string]: any; }
export interface ElementChildrenAttribute { children?: any; }}