[TSX] Optional props(with default) from mixins or extends are treated as required
Version
3.0.0-rc.9
Reproduction link
Steps to reproduce
- checkout
tsx-typeerror
branch ofwonderful-panda/vue-next
- Run build and test-dts
Below code is a simplified example. mP1 should be optional, but treated as required in TSX.
const Mixin = defineComponent({
props: {
mP1: { type: String, default: "a" }
}
})
const MyComponent = defineComponent({
mixins: [Mixin]
}
const elm = <MyComponent /> // TS2322 Property 'mP1' is missing
/* extends also has same problem */
const MyComponent2 = defineComponent({
extends: Mixin
}
const elm = <MyComponent2 /> // TS2322 Property 'mP1' is missing
What is expected?
no error (mP1 is treated as optional)
What is actually happening?
mP1 is treated as required and compilation error TS2322 occurred.