import { useEffect, useRef } from "react"; import { animationFrames, animationTiming } from "../utils"; const AnimatedUseEffect = () => { const ref = useRef(null); useEffect(() => { console.log("animation with useEffect!"); ref.current?.animate(animationFrames, animationTiming); }, []); return ( <h1 ref={ref}>Hello, world</h1> ); }; export default AnimatedUseEffect;