Open madsh93 opened 1 year ago
Same problem, try not to deconstruct it:
const motions = useMotions()
Tested on v. 2.0.0-beta.27 and v. 2.0.0, accessing useMotions() with or without deconstruct is always empty ( equals to empty object )
I recently encoutered the same issue. After adding a few console log (or just randomly?) the useMotion started working again but it was not stable, and after reloading and/or restarting nuxt it broke again.
I got it working again after downgrading nuxt to 3.4.3 and deleting the .nuxt
folder.
It looks like this is due to the properties on the object returned by useMotions
being set after script
is run. As mentioned already, a possible workaround would be not to deconstruct the object.
I'll mark this a bug since deconstruction is shown as an example in the documentation, will investigate it later!
Following the examples from the docs: https://motion.vueuse.org/directive-usage.html#access-a-v-motion-instance
Note the
custom
from useMotions() isundefined
Tested on v. 2.0.0-beta.27