fix(types/tsx): make JSX.Element extend VNode (#3171)

This commit is contained in:
Kael
2021-03-30 08:38:25 +11:00
committed by GitHub
parent d09045282c
commit 4f26835dac
4 changed files with 20 additions and 3 deletions

View File

@@ -4,6 +4,8 @@ import {
createVNode,
VNodeArrayChildren,
Fragment,
Text,
Comment,
isVNode
} from './vnode'
import { Teleport, TeleportProps } from './components/Teleport'
@@ -84,6 +86,16 @@ export function h(
children?: RawChildren | RawSlots
): VNode
// text/comment
export function h(
type: typeof Text | typeof Comment,
children?: string | number | boolean
): VNode
export function h(
type: typeof Text | typeof Comment,
props?: null,
children?: string | number | boolean
): VNode
// fragment
export function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode
export function h(

View File

@@ -26,6 +26,7 @@
// Kanitkorn Sujautra <https://github.com/lukyth>
// Sebastian Silbermann <https://github.com/eps1lon>
import { VNode } from '@vue/runtime-core'
import * as CSS from 'csstype'
export interface CSSProperties extends CSS.Properties<string | number> {
@@ -1338,7 +1339,7 @@ type NativeElements = {
declare global {
namespace JSX {
interface Element {}
interface Element extends VNode {}
interface ElementClass {
$props: {}
}