Destructuring Reactive Data
In this video, we learn why it’s not a good idea to de-structure reactive data defined with the reactive function. Instead you should:
- Reference the reactive object directly
- Define a computed prop (if you’re ok with the data being read only)
- Use
toRefs
Finally, when creating your composables, definitely make sure you aren’t just returning a reactive object. Why? Because most Vue developers expect composables to be destructurable.
- Chapter 1
Common Vue.js Mistakes
14 lessons • 1 hr0:56
8:35
9:11
3:24
6:41
10:00
2:25
5:42
5:21
4:04
1:57
0:52