reactive([]) does not trigger computed
bkuster opened this issue · comments
Ben Kuster commented
Issue
When creating a reactive array and using it in a computed, changes to the array (using push etc.) does not trigger the computed property as expected.
See this code pen for a working example of this in Vue3.
{
setup() {
const foo = reactive([]);
const bar = computed(() => foo.map(f => f));
setTimeout(() => { foo.push(true); } , 1000);
return {
bar,
};
},
}
```
Łukasz Szyszko commented
Use ref for []
Ben Kuster commented
okay, so this is a known limitation and i have simply missread the documentation, assuming, if i have a reactive array, i will need refs within said array. sorry for the noise.