diff --git a/src/v3/reactivity/ref.ts b/src/v3/reactivity/ref.ts index 33495806da..9a1d441adc 100644 --- a/src/v3/reactivity/ref.ts +++ b/src/v3/reactivity/ref.ts @@ -51,9 +51,13 @@ declare const ShallowRefMarker: unique symbol export type ShallowRef = Ref & { [ShallowRefMarker]?: true } -export function shallowRef(value: T | Ref): Ref | ShallowRef -export function shallowRef(value: T): T -export function shallowRef(value: T): ShallowRef +export function shallowRef( + value: T +): Ref extends T + ? T extends Ref + ? IfAny, T> + : ShallowRef + : ShallowRef export function shallowRef(): ShallowRef export function shallowRef(value?: unknown) { return createRef(value, true)