jsx-dev-runtime.ts
This file
Path
src/jsx/jsx-dev-runtime.ts
26 lines 路 679 bytes 路 TypeScript
Last changed by
Not known.
History of this fileTake it
123456789101112131415161718192021222324252627/** * @module * This module provides Hono's JSX dev runtime. */
import type { HtmlEscapedString } from '../utils/html'import { jsxFn } from './base'import type { JSXNode } from './base'export { Fragment } from './base'export type { JSX } from './base'
export function jsxDEV( tag: string | Function, props: Record<string, unknown>, key?: string): JSXNode { let node: JSXNode if (!props || !('children' in props)) { node = jsxFn(tag, props, []) } else { const children = props.children as string | HtmlEscapedString node = Array.isArray(children) ? jsxFn(tag, props, children) : jsxFn(tag, props, [children]) } node.key = key return node}