Vue · Reactivity

VUE0008Prefer refs from reusable composables

Finds Vue reactivity code that should use the supported composable ref return pattern instead.

Why it happens

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

Fix

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
}

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

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