unref() Unwrap a Ref
Last updated: 2026-10-22
unref() Unwrap a Ref
unref() is shorthand for isRef(v) ? v.value : v — refs yield their inner value, plain values pass through.
| Group | Reactivity: Utilities |
|---|---|
| Kind | API |
| Scope | Component |
| Vue Version | 3.0+ |
| SSR Support | Yes |
📝 Syntax
unref(count) // same as count.value
unref(42) // 42
⚙️ Arguments
| ref | A ref or any plain value |
|---|
Returns:The inner value of a ref, or the value itself
▶ Example
Edit the code below and see the live result:
Output:
Shows 'Current count: 17'.
💡 Key Points
💡 Tip Use it when concatenating, comparing or passing values to non-Vue code.
⚠️ Warning unref(ref(0)) is 0 — do not use truthiness to test presence; use isRef for type checks.
🏷️ Related Utilities
💡 Related Cases
More case studies coming soon.
📚 Related Tutorials
❓ FAQ
Q How is it different from writing .value?
A unref is safe on plain values; .value on a plain value is undefined.
Q Is it needed in templates?
A No — templates unwrap automatically; use it in script logic.
Q Difference from toValue?
A toValue also handles getters (3.3+); unref only handles refs.