mirror of
https://github.com/honojs/hono.git
synced 2024-11-24 11:07:29 +01:00
fix(jsx): fix a jsx-runtime
bug (#1070)
* fix(jsx): fix a `jsx-runtime` * fixed for Bun * denoify
This commit is contained in:
parent
21f4c196e7
commit
c50dcf03bb
@ -4,7 +4,7 @@ import type { JSXNode } from './index.ts'
|
||||
export { Fragment } from './index.ts'
|
||||
|
||||
export function jsxDEV(tag: string | Function, props: Record<string, unknown>): JSXNode {
|
||||
const children = (props.children ?? []) as (string | HtmlEscapedString)
|
||||
const children = (props.children ?? []) as string | HtmlEscapedString
|
||||
delete props['children']
|
||||
return jsx(tag, props, children)
|
||||
return Array.isArray(children) ? jsx(tag, props, ...children) : jsx(tag, props, children)
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import type { JSXNode } from '.'
|
||||
export { Fragment } from '.'
|
||||
|
||||
export function jsxDEV(tag: string | Function, props: Record<string, unknown>): JSXNode {
|
||||
const children = (props.children ?? []) as (string | HtmlEscapedString)
|
||||
const children = (props.children ?? []) as string | HtmlEscapedString
|
||||
delete props['children']
|
||||
return jsx(tag, props, children)
|
||||
return Array.isArray(children) ? jsx(tag, props, ...children) : jsx(tag, props, children)
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"src/**/*.mts",
|
||||
"src/**/*.test.ts"
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.test.tsx"
|
||||
],
|
||||
}
|
Loading…
Reference in New Issue
Block a user