Skip to content

Commit

Permalink
fix(types): should wrap the original type with Reactive in `Distrib…
Browse files Browse the repository at this point in the history
…uteRef`
  • Loading branch information
KazariEX committed Oct 27, 2024
1 parent ed01d92 commit 2a4670b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/reactivity/src/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { Dep, getDepFromReactive } from './dep'
import {
type Builtin,
type Reactive,
type ShallowReactiveMarker,
isProxy,
isReactive,
Expand Down Expand Up @@ -489,7 +490,7 @@ export type ShallowUnwrapRef<T> = {
[K in keyof T]: DistributeRef<T[K]>
}

type DistributeRef<T> = T extends Ref<infer V, unknown> ? V : T
type DistributeRef<T> = T extends Ref<infer V, unknown> ? Reactive<V> : T

export type UnwrapRef<T> =
T extends ShallowRef<infer V, unknown>
Expand Down

0 comments on commit 2a4670b

Please sign in to comment.