Using the Vue composition API, I encountered an issue with TypeScript regarding a ref for an array of objects. Each object in the array has a value property, but TypeScript seems to be confusing the ref's value with the property value inside each array.
https://i.sstatic.net/PPXso.png
The screenshot above illustrates how TypeScript recognizes that the type of 'arr' is an array of objects containing 'name' and 'value', but when using ref, it incorrectly detects the type. Even attempts to use 'as' conversion do not resolve the problem:
const arr2 = ref(arr as { name: string; value: number }[]);
However, changing the 'value' property to something else, such as 'value2', can make it work: https://i.sstatic.net/CCcq6.png
Update:
Today, I encountered another issue as shown below:
https://i.sstatic.net/auhcN.png
I am looking for a solution to this type error. How should I proceed?