CHAPTER 05
Beginner
Vue Reactivity System
Updated: May 18, 2026
5 min read
# CHAPTER 5
Vue Reactivity System
1. Chapter Introduction
Vue's reactivity system is its most magical feature. When reactive data changes, Vue automatically updates every DOM node that depends on it — no manual DOM manipulation needed. Understanding how this works makes you a significantly better Vue developer. Vue 3 uses JavaScript Proxy under the hood (not Object.defineProperty like Vue 2).Analogy: Imagine a spreadsheet. When you change cell A1, every formula that references A1 automatically recalculates. Vue's reactivity is the same — reactive data is A1, template expressions are the formulas.
2. Learning Objectives
-
Understand
ref()for primitive values.
-
Understand
reactive()for objects.
-
Know when to use
ref()vsreactive().
-
Understand
.valueaccess pattern.
- Build a live counter application.
3. The Reactivity Flow
text
4. ref() — Reactive Primitives
vue
5. reactive() — Reactive Objects
vue
6. ref() vs reactive() — When to Use Which
text
7. Advanced Reactivity Helpers
vue
8. Mini Project: Live Counter App
vue
9. Common Mistakes
-
Accessing
refwith.valuein the template:{{ count.value }}in the template is WRONG. Vue auto-unwraps — just use{{ count }}.
-
Destructuring a
reactive()object:const { name } = userbreaks reactivity. UsetoRefs(user)or switch toref().
10. MCQs
Question 1
ref() is used for?
Question 2
How do you access a ref in <script setup>?
Question 3
How do you access a ref in <template>?
Question 4
What Vue 3 primitive does Vue use for reactivity?
Question 5
reactive() is best used for?
Question 6
What happens if you destructure a reactive() object directly?
Question 7
How do you safely destructure a reactive object?
Question 8
isRef(count) returns?
Question 9
What does unref(x) do?
Question 10
Vue 3 reactivity does NOT use?
11. Interview Questions
-
Q: Explain the difference between
ref()andreactive()in Vue 3.
-
Q: Why does destructuring a
reactive()object break reactivity?
12. Summary
Vue 3's reactivity system is powered by JavaScript Proxy — the most efficient and complete reactivity system in any frontend framework.ref() for primitives, reactive() for objects. In modern Vue, many developers use ref() for everything for consistency. The .value pattern in <script> and auto-unwrapping in <template> is the core pattern.