Skip to content

Update v0.3.2 breaks Typescript-only type of props #146

Closed
@kukoo1

Description

@kukoo1

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions