Skip to content

Commit

Permalink
refactor(jsx): Tweaks type for jsxNode()
Browse files Browse the repository at this point in the history
  • Loading branch information
usualoma committed Dec 5, 2023
1 parent 5fbe838 commit 2e92927
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deno_dist/jsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,11 @@ const jsxFn = (
* The API might be changed.
* same as `as unknown as JSXNode`
*/
export const jsxNode = (node: HtmlEscaped | Promise<HtmlEscaped>): JSXNode => {
export const jsxNode = (node: HtmlEscaped | Promise<HtmlEscaped>): JSX.Element & JSXNode => {
if (!(node instanceof JSXNode)) {
throw new Error('Invalid node')
}
return node as JSXNode
return node as JSX.Element & JSXNode
}

export type FC<T = Props> = (
Expand Down
4 changes: 2 additions & 2 deletions src/jsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,11 @@ const jsxFn = (
* The API might be changed.
* same as `as unknown as JSXNode`
*/
export const jsxNode = (node: HtmlEscaped | Promise<HtmlEscaped>): JSXNode => {
export const jsxNode = (node: HtmlEscaped | Promise<HtmlEscaped>): JSX.Element & JSXNode => {
if (!(node instanceof JSXNode)) {
throw new Error('Invalid node')
}
return node as JSXNode
return node as JSX.Element & JSXNode
}

export type FC<T = Props> = (
Expand Down

0 comments on commit 2e92927

Please sign in to comment.