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

@@ -67,7 +67,14 @@ test('createComponent type inference', () => {
}
})
// test TSX props inference
;<MyComponent a={1} b="foo" dd={['foo']} ddd={['foo']} />
;<MyComponent
a={1}
b="foo"
dd={['foo']}
ddd={['foo']}
// should allow extraneous as attrs
class="bar"
/>
})
test('type inference w/ optional props declaration', () => {