mirror of https://github.com/vuejs/core.git
fix(types/tsx): add JSX.IntrinsicAttributes definition (#1517)
fix #1516
This commit is contained in:
parent
58b07069ad
commit
a5b4332c69
|
|
@ -1334,6 +1334,7 @@ declare global {
|
|||
// @ts-ignore supress ts:2374 = Duplicate string index signature.
|
||||
[name: string]: any
|
||||
}
|
||||
interface IntrinsicAttributes extends ReservedProps {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue