Vue · Reactivity

VUE0007Do not destructure setup props

Classic setup(props) props lose reactivity when destructured directly.

Why it happens

The props proxy is reactive, but local destructured bindings are snapshots.

Fix

Use props.foo, toRefs(props), or <script setup> reactive props destructuring.

Example

Preserve prop reactivity

Before

<script setup lang="ts">
const { count } = defineProps<{ count: number }>()
</script>

After

<script setup lang="ts">
const props = defineProps<{ count: number }>()
const count = toRef(props, 'count')
</script>

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/no-setup-props-destructure
Copyright © 2026