I can't understand this sentence.If use destructures for ref ,should still lose reactivity concection.Unless destructures result is an Object,the reactivity concection will lost #11291
-
emm ,I feel confused |
Beta Was this translation helpful? Give feedback.
Answered by
s3xysteak
Jul 5, 2024
Replies: 1 comment 1 reply
-
It means you should use: function useFunc() {
return {
one: ref(1)
}
} instead of function useFunc() {
return reactive({ one: 1 })
} Destructures them, in the first example you will get: const { one } = useFunc() // one = ref(1) in the second example you will get: const { one } = useFunc() // one = 1 instead of a Proxy, which means it has lost the reactivity |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dddssw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It means you should use:
instead of
Destructures them, in the first example you will get:
in the second example you will get: