Jump to content
Search Community

KingRetracted

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by KingRetracted

  1. @GreenSock so I figured some things out. I changed from a require() statement to an import/from statement which when running console.log(GSAP), shows the functions. It still doesn't animate and now shows this error.

    66FC8F24-D53B-41D2-83B8-8B705C6D323A.png

  2. @GreenSock I typically just use all capitals for my libraries to seperate them from my variables. I'm using gsap 3.6.0 on a repl.it server. 

    @ZachSaucier I'm on a repl.it and installed it via their package installer. However I also installed it with npm i gsapon the repl.it terminal which also proved unsuccessful.

    4060BF19-A900-4FAD-ABE3-A1287F3E2BEE.png

  3. I am using React for my fun project and to start learning and using gsap. I have a div with the ref of ``box`` and ran the line GSAP.from(box, {x: "-100px", duration: 1}) and took inspiration from the React example on the website. However, it came up with the error TypeError: GSAP.from is not a function. (In 'GSAP.from(box, { x: "-100px", duration: 1 })', 'GSAP.from' is undefined and nothing I found has worked. 

        import GSAP from "gsap";
    
    	const box = useRef();
        GSAP.from(box, { x: "-100px", duration: 1 });
        
        return (
                <div className="app" id="app">
                    <h1>Hello World</h1>
                    <div className="box" id="box" style={ {
                        margin: "0",
                        padding: "0",
                        width: "200px",
                        height: "200px",
                        backgroundColor: "#949cdf",
                    } } ref={ box }></div>
                </div>
        );

     

×
×
  • Create New...