1👍
✅
const selectedActivities = ref([]);
Since you havn’t given this a type, typescript has to infer it. It sees you passed in an array, but has no idea what should be inside that array, so it gives it the type never[]
. Trying to check a never[]
for a string does not work, because it doesn’t contain strings.
Instead, you need to specify what type of array this is:
const selectedActivities = ref<string[]>([]);
Or:
const selectedActivities = ref([] as string[]);
Source:stackexchange.com