Просмотр исходного кода

fix(types): ensure that DeepReadonly handles Ref type properly (#4714)

Thorsten Lünborg 4 лет назад
Родитель
Сommit
ed0071ac1a
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      packages/reactivity/src/reactive.ts

+ 2 - 0
packages/reactivity/src/reactive.ts

@@ -132,6 +132,8 @@ export type DeepReadonly<T> = T extends Builtin
   ? WeakSet<DeepReadonly<U>>
   : T extends Promise<infer U>
   ? Promise<DeepReadonly<U>>
+  : T extends Ref<infer U>
+  ? Ref<DeepReadonly<U>>
   : T extends {}
   ? { readonly [K in keyof T]: DeepReadonly<T[K]> }
   : Readonly<T>