Vue 3 props lose reactivity when I destructure them
Vue 3.4, script setup. I am destructuring props so I can use them in a computed, but the value never updates when the parent changes it. const { userId } = defineProps<{ userId: number }>() and then const name = computed(() => store.users[userId].name). When userId changes in the parent the computed stays on the old id. I am told to use toRefs but toRefs on defineProps feels wrong. What is the correct pattern here in 3.4?
4 replies