Vue · Middle · Question 5 of 75
When is shallowRef a better choice than ref?
- ✓Correct answer: For large immutable data (e.g. big API responses) where only replacing
.valueshould trigger updates - 2For primitives, because
refcan't hold them - 3When the value must be deeply reactive
Explanation
ref makes nested objects deeply reactive via Proxies, which costs time for huge structures. shallowRef tracks only .value replacement; use triggerRef if you mutate and need to force an update.