mirror of
https://github.com/honojs/hono.git
synced 2024-12-01 11:51:01 +01:00
14 lines
520 B
TypeScript
14 lines
520 B
TypeScript
import type { HtmlEscapedString } from '../utils/html.ts'
|
|
import { jsx } from './index.ts'
|
|
import type { JSXNode } from './index.ts'
|
|
export { Fragment } from './index.ts'
|
|
|
|
export function jsxDEV(tag: string | Function, props: Record<string, unknown>): JSXNode {
|
|
if (!props || !('children' in props)) {
|
|
return jsx(tag, props)
|
|
}
|
|
const children = props.children as string | HtmlEscapedString
|
|
delete props['children']
|
|
return Array.isArray(children) ? jsx(tag, props, ...children) : jsx(tag, props, children)
|
|
}
|