KingRetracted
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by KingRetracted
-
-
@GreenSock It didn't show an error but still hasn't ran. Here is a link to my repl.it code if that would help. I don't use codepen.io.
-
@GreenSock I am trying to tween a div with the ref of box on my React app
-
-
@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 gsap
on the repl.it terminal which also proved unsuccessful. -
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 errorTypeError: 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> );
gsap.from is not a function
in GSAP
Posted
@GreenSock I see, thank you. I will probably use mount-hooks or whatever it is called to trigger the animation. Thanks for your time and headaches.