fix(types/tsx): make JSX.Element extend VNode (#3171)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import {
|
||||
h,
|
||||
Text,
|
||||
FunctionalComponent,
|
||||
expectError,
|
||||
expectType,
|
||||
@@ -6,7 +8,7 @@ import {
|
||||
} from './index'
|
||||
|
||||
// simple function signature
|
||||
const Foo = (props: { foo: number }) => props.foo
|
||||
const Foo = (props: { foo: number }) => h(Text, null, props.foo)
|
||||
|
||||
// TSX
|
||||
expectType<JSX.Element>(<Foo foo={1} />)
|
||||
|
||||
@@ -5,9 +5,11 @@ import {
|
||||
Fragment,
|
||||
Teleport,
|
||||
expectError,
|
||||
expectType
|
||||
expectType,
|
||||
VNode
|
||||
} from './index'
|
||||
|
||||
expectType<VNode>(<div />)
|
||||
expectType<JSX.Element>(<div />)
|
||||
expectType<JSX.Element>(<div id="foo" />)
|
||||
expectType<JSX.Element>(<input value="foo" />)
|
||||
|
||||
Reference in New Issue
Block a user