function App() {
// store a reference to the box div
const boxRef = useRef();
// wait until DOM has been rendered
useEffect(() => {
gsap.to(boxRef.current, { rotation: "+=360" });
});
// DOM to render
return <div className="box" ref={boxRef}>Hello</div>;
}
const el = useRef();
const q = gsap.utils.selector(el);
useEffect(() => {
// Target ALL descendants with the class of .box
gsap.to(q(".box"), { x: 100 });
}, []);