How does reactivity work in Vue 3? What is Proxy doing under the hood?
Vue 3 wraps state in a Proxy that intercepts property reads to track which effects depend on them and property writes to trigger those effects. Unlike Vue 2's Object.defineProperty, a Proxy sees property addition and deletion and works with arrays and Map, so Vue.set is no longer needed. The trade-off is that Proxy requires modern browsers and that reactivity is lost the moment you destructure out of the proxy.