Skip to content

Inherit attributes with generic components causes type error #8372

Closed
@grindpride

Description

@grindpride

Vue version

3.3.4

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-nwkbil?file=package.json,src%2Fcomponents%2FListGeneric.vue,src%2FApp.vue,src%2Fcomponents%2FList.vue

Steps to reproduce

  1. Open a new Terminal after successful setup of dependencies
  2. Type and run npm run typecheck into the terminal
  3. See an error in App.vue file

What is expected?

There is no error occurred

What is actually happening?

TS2345: Argument of type '{ dataCy: string; "data-cy": string; modelValue: "modelValue"; "onUpdate:modelValue": any; }' is not assignable to parameter of type '{ modelValue: "modelValue"; sameModel?: string | undefined; } & VNodeProps & AllowedComponentProps & ComponentCustomProps'.
  Object literal may only specify known properties, and 'dataCy' does not exist in type '{ modelValue: "modelValue"; sameModel?: string | undefined; } & VNodeProps & AllowedComponentProps & ComponentCustomProps'.

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions