-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Description
Vue version
3.4.31
Link to minimal reproduction
Steps to reproduce
unref and toValue resolve the type incorrectly if the passed type is ShallowRef | ComputedRef | MaybeRef.
What is expected?
The return type of the text function should be string.
function test(text: ShallowRef<string> | ComputedRef<string> | MaybeRef<string>) {
return unref(text);
}What is actually happening?
But it is string | ShallowRef<string> instead.
System Info
Typescript 5.5.3Any additional comments?
function test(text: ShallowRef<string> | MaybeRef<string>) {
return unref(text);
}and
function test(text: ShallowRef<string> | ComputedRef<string>) {
return unref(text);
}have the only string as return type as expected.
Metadata
Metadata
Assignees
Labels
No labels