Skip to content
Myr

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 file

Take it

The walk stopped after 200 commits: lines older than f0b094d point at it.

Merge commit from forkYusuke Wadabefore adoptionf0b094d

lines 1–26why, one step back
1/**
2 * @module3 * This module provides Hono's JSX dev runtime.4 */56import type { HtmlEscapedString } from '../utils/html'7import { jsxFn } from './base'8import type { JSXNode } from './base'9export { Fragment } from './base'10export type { JSX } from './base'1112export function jsxDEV(13 tag: string | Function,14 props: Record<string, unknown>,15 key?: string16): JSXNode {17 let node: JSXNode18 if (!props || !('children' in props)) {19 node = jsxFn(tag, props, [])20 } else {21 const children = props.children as string | HtmlEscapedString22 node = Array.isArray(children) ? jsxFn(tag, props, children) : jsxFn(tag, props, [children])23 }24 node.key = key25 return node26}