Pixelcaps Posted October 19, 2021 Share Posted October 19, 2021 Hello, I am getting this error for an animation -> invalid modifiers tween value: [object Object]. I am using gsap version 2 inside a React project. I've read from another forum post that its because the plugin is not loaded. My question is how do you load it inside an actual project, not codepen? Link to comment Share on other sites More sharing options...
Cassie Posted October 19, 2021 Share Posted October 19, 2021 Hi Pixelcaps - Firstly. Is there a reason you're using GSAP 2? 1 Link to comment Share on other sites More sharing options...
OSUblake Posted October 19, 2021 Share Posted October 19, 2021 3 hours ago, Cassie said: Hi Pixelcaps - Firstly. Is there a reason you're using GSAP 2? I'd second that. Most of the v2 syntax will work in v3, and the rest is pretty easy to convert using our Migration Guide. If you must use v2, you would just import like every other plugin. The only difference is that there is no registration of the plugin, so you should add the plugin to a dummy value so it doesn't get dropped due to tree shaking. import { TweenMax } from "gsap"; import { ModifiersPlugin } from "gsap/ModifiersPlugin"; const plugins = [ModifiersPlugin]; TweenMax.to("#foo", 1, { x: 100, modifiers: { ... } }) 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now