Jump to content
Search Community

Importing Draw SVG in React doesn't seem to be working

JoeH test
Moderator Tag

Recommended Posts

I haven't had this problem with other plugins apart from Draw SVG, I'm not sure what I am doing wrong, the import directory is correct and the code I am using has worked on other projects.

 

It seems to be out of scope because the line - import drawSVG from "gsap/dist/DrawSVGPlugin"; is not highlighting, it remains greyed out.

 

And of course the animation is not working. I have taken a screenshot

 

 

Screenshot 2020-10-12 at 18.00.01.png

Link to comment
Share on other sites

  • 2 years later...

Hi @Parivesh and welcome to the GreenSock forums!

 

Draw SVG  Plugin is a Club GreenSock bonus plugin and should be installed following the instructions in this page:

https://greensock.com/docs/v3/Installation/

 

You can also test all the Club GreenSock bonus plugins and tools using the GSAP Trial package on localhost and Codesandbox. Just install it running this:

npm install --save gsap-trial

Then you can import and  use them:

import { gsap } from "gsap-trial/dist/gsap";
import { DrawSVGPlugin } from "gsap-trial/dist/DrawSVGPlugin";

gsap.registerPlugin(DrawSVGPlugin);

Let us know if you have any other questions.

 

If you keep having issues, please provide a simple minimal demo in order to see what could be the problem.

 

Happy Tweening!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...