fix(types/tsx): add JSX.IntrinsicAttributes definition (#1517)

fix #1516
This commit is contained in:
wonderful-panda 2020-07-07 10:59:26 +09:00 committed by GitHub
parent 58b07069ad
commit a5b4332c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -1334,6 +1334,7 @@ declare global {
// @ts-ignore supress ts:2374 = Duplicate string index signature.
[name: string]: any
}
interface IntrinsicAttributes extends ReservedProps {}
}
}

View File

@ -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