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
{{ message }}
Repository navigation
3.5.29 regression: type error when assigning $attrs.class to :class #14489
The Stackblitz repro will reproduce the type error too if you run npm run build.
What is expected?
No type error
What is actually happening?
Type error:
error TS2345: Argument of type '{ class: unknown; }' is not assignable to parameter of type 'HTMLAttributes & ReservedProps & Record<string, unknown>'.
Type '{ class: unknown; }' is not assignable to type 'HTMLAttributes'.
Types of property 'class' are incompatible.
Type 'unknown' is not assignable to type 'ClassValue'.
<div :class="$attrs.class">
This is a regression caused by #14441 changing the type of HTMLAttributes.class from any to ClassValue | undefined, while the type of $attrs is just Record<string, unknown>
Activity
fix(types): narrow useAttrs class/style typing for TSX (#14492)