DavTho Posted February 10, 2020 Posted February 10, 2020 I want to use the bonus plugin MotionPathPlugin. I moved the gsap-bonus.tgz file from the extracted download zip to my local project directory and ran npm install --save ./gsap-bonus.tgz. Then in my package.json I get the line: "gsap": "file:gsap-bonus.tgz", This doesn't seem right, and when I try npm start to run the project, I get 'MotionPathPlugin' is not defined How do I use MotionPathPlugin in React?
ZachSaucier Posted February 10, 2020 Posted February 10, 2020 Hey Dav. 5 minutes ago, DavTho said: This doesn't seem right Why is that? That way NPM knows where to find all the GSAP files including CustomEase. 5 minutes ago, DavTho said: when I try npm start to run the project, I get "'MotionPathPlugin' is not defined". How do I use MotionPathPlugin in React? We highly recommend using our Install Helper if you're having trouble importing GSAP or parts of it. Selecting MotionPath with ES Modules selected will generate the following code: import { gsap } from "gsap"; import { MotionPathPlugin } from "gsap/MotionPathPlugin"; gsap.registerPlugin(MotionPathPlugin); You likely are not importing it and/or registering it 3
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