Skip to content

vue-doctor/ecosystem/pinia-no-destructure ​

Directly destructuring a Pinia store breaks reactivity. Use storeToRefs instead.

PropertyValue
CategoryEcosystem
Default Severitywarning
Confidencemedium
FixableNo
Engineoxlint
Sincev1.1.0
Frameworksvue, nuxt

Why it matters ​

Directly destructuring a Pinia store breaks reactivity. Use storeToRefs instead.

How to fix ​

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

Agent Guidance ​

Do not destructure a Pinia store directly. Use const { count } = storeToRefs(store) for state and getters, and call actions on the store object.


Rule source: vue-doctor/ecosystem/pinia-no-destructure

Released under the MIT License.