Skip to content

Commit

Permalink
fix(jsx): The third argument of jsx(), key, is optional (#2162)
Browse files Browse the repository at this point in the history
  • Loading branch information
usualoma committed Feb 7, 2024
1 parent 1549c70 commit 7cc7adf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deno_dist/jsx/dom/jsx-dev-runtime.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Props } from '../base.ts'
import { normalizeIntrinsicElementProps } from '../utils.ts'

export const jsxDEV = (tag: string | Function, props: Props, key: string | undefined) => {
export const jsxDEV = (tag: string | Function, props: Props, key?: string) => {
if (typeof tag === 'string') {
normalizeIntrinsicElementProps(props)
}
Expand Down
2 changes: 1 addition & 1 deletion deno_dist/jsx/jsx-dev-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export { Fragment } from './base.ts'
export function jsxDEV(
tag: string | Function,
props: Record<string, unknown>,
key: string | undefined
key?: string
): JSXNode {
let node: JSXNode
if (!props || !('children' in props)) {
Expand Down
2 changes: 1 addition & 1 deletion src/jsx/dom/jsx-dev-runtime.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Props } from '../base'
import { normalizeIntrinsicElementProps } from '../utils'

export const jsxDEV = (tag: string | Function, props: Props, key: string | undefined) => {
export const jsxDEV = (tag: string | Function, props: Props, key?: string) => {
if (typeof tag === 'string') {
normalizeIntrinsicElementProps(props)
}
Expand Down
2 changes: 1 addition & 1 deletion src/jsx/jsx-dev-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export { Fragment } from './base'
export function jsxDEV(
tag: string | Function,
props: Record<string, unknown>,
key: string | undefined
key?: string
): JSXNode {
let node: JSXNode
if (!props || !('children' in props)) {
Expand Down

0 comments on commit 7cc7adf

Please sign in to comment.