types: improve h() and TSX type inference

- Should allow extraneous props as attrs in TSX
- Should check props when using constructor type returned by
  createComponent() in h()
This commit is contained in:
Evan You
2019-10-31 12:43:05 -04:00
parent b114cdf6ee
commit 3a6dcd3aba
4 changed files with 48 additions and 16 deletions

View File

@@ -133,9 +133,7 @@ export function h<P>(
): VNode
export function h<P extends string>(
type: ComponentOptionsWithArrayProps<P>,
// TODO for now this doesn't really do anything, but it would become useful
// if we make props required by default
props?: (RawProps & { [key in P]?: any }) | null,
props?: RawProps | null,
children?: RawChildren | RawSlots
): VNode
export function h<P>(