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>
);