Closed
Description
Declaring props type with Typescript was broken after updated from v0.3.1 to v0.3.2
interface Props {
prop1: string[];
prop2: number[];
}
export default createComponent({
props: (['prop1', 'props2'] as unknown) as Props,
})
The compiler complains
No overload matches this call. Overload 1 of 2, '(options: ComponentOptionsWithoutProps<never, unknown>): VueProxy<never, unknown>', gave the following error. Type 'Props' is not assignable to type 'undefined'.
I investigated and found that this change cause the break.
0565acb#diff-f2fa4059dd5efeb563915aed92f20664R81
From PropsOptions = ComponentPropsOptions
to PropsOptions extends ComponentPropsOptions = ComponentPropsOptions
How to exactly declare props type using typescript ?
Metadata
Metadata
Assignees
Labels
No labels