Preserving Reactivity with toRefs
Destructuring or spreading a reactive object copies plain current values, severing the Proxy connection so future updates are lost; toRefs converts each property to a ref linked back to the source object (toRef for one property), which is why composables return objects of refs rather than reactive objects.
This Concept is waiting for its first lesson!
Destructuring or spreading a reactive object copies plain current values, severing the Proxy connection so future updates are lost; toRefs converts each property to a ref linked back to the source object (toRef for one property), which is why composables return objects of refs rather than reactive objects.
Are you a teacher? Sign in to start contributing.
Sign In