ref to ref #9664
Unanswered
softwareCobbler
asked this question in
Help/Questions
ref to ref
#9664
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
When you pass a Ref object to const obj = ref({ a: 1 })
const r = ref(obj)
console.log(obj === r) // true core/packages/reactivity/src/ref.ts Lines 127 to 132 in 1c525f7 However, when you assign a value to core/packages/reactivity/src/ref.ts Lines 154 to 164 in 1c525f7 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Occasionally I want to form a ref to a ref. Ref unwrapping prevents this:
but assigning a ref after initialization has led me to a pattern that does seem to work:
Are there any gotchas with the latter case? It seems to work as I had hoped, but also seems to conflict with the docs:
where maybe the above documentation only applies to "during the initial call to ref()"
Beta Was this translation helpful? Give feedback.
All reactions