Closed
Description
Vue version
3.313
Link to minimal reproduction
Steps to reproduce
Create a type that is the union of a Ref of a non-primitive type and null, e.g. type X = Ref<{ name: string }> | null
.
What is expected?
UnwrapRef<X>
should be { name: string } | null
.
What is actually happening?
Well... in TS script block it looks like UnwrapRef<X>
is right, but when looked at inside the template block, it's still Ref<{ name: string }> | null
. (see repro link)
As a consequence, using x
in template (where refs are unwrapped automatically) fails type-checking as TS doesn't see the right type.
System Info
See repro in Vue SFC Playground.
Any additional comments?
This is the same issue as #3990 which was fixed. Maybe it regressed in a later release?
Metadata
Metadata
Assignees
Labels
No labels