Skip to content

vue-doctor/reactivity/no-reactive-destructure ​

Use toRefs(state) before destructuring to keep reactivity, or access properties directly: state.count

PropertyValue
CategoryReactivity
Default Severitywarning
Confidencemedium
FixableNo
Engineoxlint
Sincev1.0.0
Frameworksvue, nuxt

Why it matters ​

Use toRefs(state) before destructuring to keep reactivity, or access properties directly: state.count

How to fix ​

Review the finding and update the code according to best practices below.

Agent Guidance ​

Destructuring a reactive() object copies plain values and drops reactivity. Wrap it with toRefs(state) before destructuring, or read state.prop directly.


Rule source: vue-doctor/reactivity/no-reactive-destructure

Released under the MIT License.