I keep encountering these errors in the console:
- TS2339: Property 'shop' is not found in type '(Ref<never[]> | ((id: number) => Promise))[]'.
- TS2339: Property 'getShop' is not found in type '(Ref<never[]> | ((id: number) => Promise))[]'.
What causes these errors to happen? How can I resolve them?Example code:
// useShop.ts
import { ref } from "vue"
export default function useShop() {
const shop = ref([])
const getShop = async (id: number) => {
// fetch data...
shop.value = []
}
return [shop, getShop]
}
// Detail.vue
export default defineComponent({
components: {},
setup() {
const { shop, getShop } = useShop()
return {}
},
})