Skip to content

Commit

Permalink
fix(types/tsx): add JSX.IntrinsicAttributes definition (#1517)
Browse files Browse the repository at this point in the history
fix #1516
  • Loading branch information
wonderful-panda authored Jul 7, 2020
1 parent 58b0706 commit a5b4332
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/runtime-dom/types/jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,7 @@ declare global {
// @ts-ignore supress ts:2374 = Duplicate string index signature.
[name: string]: any
}
interface IntrinsicAttributes extends ReservedProps {}
}
}

Expand Down
2 changes: 2 additions & 0 deletions test-dts/functionalComponent.test-d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const Foo = (props: { foo: number }) => props.foo

// TSX
expectType<JSX.Element>(<Foo foo={1} />)
expectType<JSX.Element>(<Foo foo={1} key="1" />)
expectType<JSX.Element>(<Foo foo={1} ref="ref" />)
// @ts-expect-error
expectError(<Foo />)
// @ts-expect-error
Expand Down

0 comments on commit a5b4332

Please sign in to comment.