Skip to content

Commit 7284ad9

Browse files
authored
fix(types): allow any object in toRefs (#668)
1 parent 4fcea65 commit 7284ad9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/reactivity/ref.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Data } from '../component'
21
import { RefKey } from '../utils/symbols'
32
import { proxy, isPlainObject, warn } from '../utils'
43
import { reactive, isReactive, shallowReactive } from './reactive'
@@ -119,7 +118,7 @@ export function unref<T>(ref: T): T extends Ref<infer V> ? V : T {
119118
return isRef(ref) ? (ref.value as any) : ref
120119
}
121120

122-
export function toRefs<T extends Data = Data>(obj: T): ToRefs<T> {
121+
export function toRefs<T extends object>(obj: T): ToRefs<T> {
123122
if (__DEV__ && !isReactive(obj)) {
124123
warn(`toRefs() expects a reactive object but received a plain one.`)
125124
}

0 commit comments

Comments
 (0)