How to Live With Deep Reactivity — Convenient, and Dangerous
Vue uses Proxy to provide reactivity for mutations on ordinary data structures.
While this is convenient, it's also a dangerous feature: things like `defineModel`, writable computed, and even props themselves can become a source of confused data flow through implicit mutation.
For example, when you pass an object as a prop, the child component it's passed to can mutate that object without anyone stopping it or raising a complaint.
In this lightning talk, drawing on real experience, I'll introduce common patterns of data-flow confusion caused by deep reactivity, and consider what countermeasures are available.
Kina
How to Live With Deep Reactivity — Convenient, and Dangerous
Vue uses Proxy to provide reactivity for mutations on ordinary data structures.
While this is convenient, it's also a dangerous feature: things like `defineModel`, writable computed, and even props themselves can become a source of confused data flow through implicit mutation.
For example, when you pass an object as a prop, the child component it's passed to can mutate that object without anyone stopping it or raising a complaint.
In this lightning talk, drawing on real experience, I'll introduce common patterns of data-flow confusion caused by deep reactivity, and consider what countermeasures are available.
