Vue · VUE0033

Do not destructure primitives from reactive()

Flags primitive properties destructured from reactive() or shallowReactive() state, which become plain values.
VUE0033vite-doctor/vuereactivityerrorSuggestion

Run this rule

pnpm vite-doctor . --framework vue --rules vue/reactivity/no-reactive-destructure

Why it matters

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.

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