isRef() Check Whether a Value Is a Ref
Last updated: 2026-10-22
isRef() Check Whether a Value Is a Ref
isRef() tells whether a value is a ref object — handy in utilities that must handle both plain and reactive inputs.
| Group | Reactivity: Utilities |
|---|---|
| Kind | API |
| Scope | Component |
| Vue Version | 3.0+ |
| SSR Support | Yes |
📝 Syntax
isRef(count) // true
isRef(0) // false
isRef(reactive({})) // false (that is a reactive proxy)
⚙️ Arguments
| value | Any value |
|---|
Returns:Boolean
▶ Example
Edit the code below and see the live result:
Output:
Shows 'a ref / a plain value / a plain value'.
💡 Key Points
💡 Tip Guard with isRef before touching .value so callers may pass either form.
ℹ️ Note A reactive proxy is not a ref; refs nested in objects are auto-unwrapped.
🏷️ Related Utilities
💡 Related Cases
More case studies coming soon.
📚 Related Tutorials
❓ FAQ
Q When do I need it?
A In reusable utilities accepting either form, or when debugging a value's type.
Q Do isRef and isReactive overlap?
A No — ref wrappers and reactive proxies are distinct kinds.
Q Do I need it in templates?
A No — templates unwrap refs automatically.