Closed nattyluke closed 2 years ago
aah Problem solved: you should import/get your composables in the root of your setup function and not in a async function inside setup.
@nattyluke Yes. it also mentioned in Vue
documents: https://vuejs.org/guide/reusability/composables.html#conventions-and-best-practices
Thank you for your work! I'm currently playing around with composition API and vue2. useStore() works as expected in a vue component. When I'm trying to write a composable (which is basically a ts file exporting a function) I can't use useState(), it's giving me the error message from the title of this Issue. So I have to use useStore in my main Component and give it as 'prop'/ variable to my composable? Then useStore ist not better then getting the store directly from the context.