Normally. as far as I understand the whole concept, you must wrap with toRefs a value, which you want to spread or destructure in order to retain its reactivity.
And in case of props, which you pass as parameter to setup() you can't use destructuring inside function signature, e.g setup({name}), because as soon as the name prop will be updated, you end up with its old value due to lost of reactivity. Destructuring is supported only for properties of context, so I suppose this should work: setup(props, {attrs, emit}).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Normally. as far as I understand the whole concept, you must wrap with
toRefs
a value, which you want to spread or destructure in order to retain its reactivity.And in case of props, which you pass as parameter to
setup()
you can't use destructuring inside function signature, e.gsetup({name})
, because as soon as thename
prop will be updated, you end up with its old value due to lost of reactivity. Destructuring is supported only for properties ofcontext
, so I suppose this should work:setup(props, {attrs, emit})
.