nuxt-no-props-destructure
Narrow trigger extracted from skills/vue-nuxt-vuetify-conventions §1.9, so destructuring a reactive
props object routes here directly instead of only through the whole Nuxt/Vue block.
When
Writing or reviewing <script setup> code that reads a component's props — especially a
destructuring assignment (const { foo } = props).
Steps
- Never destructure a reactive
propsobject directly. The value is copied at that instant and never updates again. - Read
props.foodirectly, or go throughtoRefs(props)to get a reactive ref per field, or through acomputedthat readsprops.fooinside its getter. - Nothing errors when this is done wrong — the component simply keeps rendering the first value it ever saw, which reads as a caching bug somewhere else entirely, not a destructuring mistake.
Output / checkpoint
No const { ... } = props in the diff — every prop read goes through props.foo, toRefs(props),
or a computed.
Guardrails
definePropsreturn value is the object to avoid destructuring directly; a default extracted viawithDefaultsis still a prop and still subject to this rule.- The neighbouring compiler-macro rule (
defineProps/defineEmitsnever imported) lives right next to this one inskills/vue-nuxt-vuetify-conventions§1 — read it if the confusion is about macros rather than reactivity.
Origin
No external source: this is skills/vue-nuxt-vuetify-conventions §1.9 extracted to its own trigger.
Written 2026-09-09, same restructuring pilot as laravel-no-db-enums.