Vue · Reactivity

VUE0033Do not destructure primitives from reactive()

Flags primitive properties destructured from reactive() or shallowReactive() state, which become plain values.

Why it happens

Vue tracks reactive() state through property access on the proxy. Destructuring a primitive property copies its current value into a plain local, so later writes to state.count never reach that local or the template, computed values, and watchers that read it. Destructuring straight out of reactive() discards the proxy, so the values are never reactive at all.

Fix

Read state.count where the value is used, or destructure toRefs(state) and read count.value in script. Doctor reports only keys that reactive() initializes with a primitive literal; nested objects stay reactive proxies after destructuring, and destructuring inside callbacks reads a fresh value on each call, so neither is reported.

Example

Keep reactive state connected

Before

<script setup lang="ts">
const state = reactive({ count: 0 })
const { count } = state
const increment = () => state.count++
</script>

<template>
  <button @click="increment">{{ count }}</button>
</template>

After

<script setup lang="ts">
const state = reactive({ count: 0 })
const { count } = toRefs(state)
const increment = () => state.count++
</script>

<template>
  <button @click="increment">{{ count }}</button>
</template>

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-reactive-destructure
Copyright © 2026