You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it will work correctly or there are any better solution to properly type props in TS
What is actually happening?
setup function throw a ts error by Vetur:
No overload matches this call.
The last overload gave the following error.
Type '(this: void, props: Props) => { count: Ref; }' is not assignable to type '(this: void, props: Readonly<{ todo: { [key: string]: any; }; } & {}>, ctx: SetupContext<Record<string, any>>) => void | RenderFunction | { ...; }'.
Types of parameters 'props' and 'props' are incompatible.
Type 'Readonly<{ todo: { [key: string]: any; }; } & {}>' is not assignable to type 'Props'.
Types of property 'todo' are incompatible.
Type '{ [key: string]: any; }' is missing the following properties from type 'TodoItem': id, text, completedVetur(2769)
Version
3.0.0-beta.18
Reproduction link
https://github.com/whu-luojian/webpack-vue3
Steps to reproduce
What is expected?
it will work correctly or there are any better solution to properly type props in TS
What is actually happening?
setup function throw a ts error by Vetur:
No overload matches this call.
The last overload gave the following error.
Type '(this: void, props: Props) => { count: Ref; }' is not assignable to type '(this: void, props: Readonly<{ todo: { [key: string]: any; }; } & {}>, ctx: SetupContext<Record<string, any>>) => void | RenderFunction | { ...; }'.
Types of parameters 'props' and 'props' are incompatible.
Type 'Readonly<{ todo: { [key: string]: any; }; } & {}>' is not assignable to type 'Props'.
Types of property 'todo' are incompatible.
Type '{ [key: string]: any; }' is missing the following properties from type 'TodoItem': id, text, completedVetur(2769)
Related issues:
#1155
#1114
The text was updated successfully, but these errors were encountered: