Vue · VUE0008

Prefer refs from reusable composables

Finds Vue reactivity code that should use the supported composable ref return pattern instead.
VUE0008vite-doctor/vuereactivitywarnSuggestion

Run this rule

pnpm vite-doctor . --framework vue --rules vue/reactivity/prefer-composable-ref-return

Why it matters

Returning ref.value gives callers a snapshot; returning the ref preserves updates and lets callers compose it with Vue reactivity.

Use the Vue-supported composable ref return pattern instead.

Example

Return refs from composables

Before

export function useCounter() {
  const count = ref(0)
  return count.value
}

After

export function useCounter() {
  const count = ref(0)
  return count
}
Copyright © 2026