Skip to content

Commit a5b4332

Browse files
fix(types/tsx): add JSX.IntrinsicAttributes definition (#1517)
fix #1516
1 parent 58b0706 commit a5b4332

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/runtime-dom/types/jsx.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@ declare global {
13341334
// @ts-ignore supress ts:2374 = Duplicate string index signature.
13351335
[name: string]: any
13361336
}
1337+
interface IntrinsicAttributes extends ReservedProps {}
13371338
}
13381339
}
13391340

test-dts/functionalComponent.test-d.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const Foo = (props: { foo: number }) => props.foo
55

66
// TSX
77
expectType<JSX.Element>(<Foo foo={1} />)
8+
expectType<JSX.Element>(<Foo foo={1} key="1" />)
9+
expectType<JSX.Element>(<Foo foo={1} ref="ref" />)
810
// @ts-expect-error
911
expectError(<Foo />)
1012
// @ts-expect-error

0 commit comments

Comments
 (0)