Subscribe on changes!

Can you add ref unwrapping for reactive array?

avatar
Feb 21st 2021

What problem does this feature solve?

Check out: https://jsfiddle.net/g3xjmsz0/1/

What does the proposed API look like?

const {ref, reactive} = Vue;


const reactiveArray = reactive([ref("a"), ref("b"), ref("c")]);


// Does not resolve ref
console.log(reactiveArray[0]);

// Can you add automatically ref unwrapping for reactive array like this ^?

// It's very uncomfortable
console.log(reactiveArray[0].value);
avatar
Feb 21st 2021

reactive does not work with arrays. And this feature request doesn't matter.