Jump to content
Search Community

KingRetracted

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

KingRetracted's Achievements

0

Reputation

  1. @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.
  2. @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.
  3. @GreenSock I am trying to tween a div with the ref of box on my React app
  4. @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.
  5. @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.
  6. 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...