types: improve h inference + infer required props without need for as const

This commit is contained in:
Evan You
2019-11-01 17:06:19 -04:00
parent b5c501c0b4
commit 7b7b8ef221
4 changed files with 7 additions and 18 deletions

View File

@@ -1,5 +1,4 @@
import {
VNodeTypes,
VNode,
VNodeProps,
createVNode,
@@ -146,11 +145,7 @@ export function h<P>(
): VNode
// Actual implementation
export function h(
type: VNodeTypes,
propsOrChildren?: any,
children?: any
): VNode {
export function h(type: any, propsOrChildren?: any, children?: any): VNode {
if (arguments.length === 2) {
if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
// single vnode without props