INNER CODE UNIT · JavaScript
PerfSection
christopherkarani/Wax · Resources/website/src/pages/index.js:110
function PerfSection() {
const [animated, setAnimated] = useState(false);
const ref = useRef(null);
useEffect(() => {
const el = ref.current;
if (!el || typeof IntersectionObserver === "undefined") { setAnimated(true); return; }
const obs = new IntersectionObserver(
([e]) => { if (e.isIntersecting) setAnimated(true); },
{ threshold: 0.2 }
);
obs.observe(el);
return () => obs.disconnect();
}, []);
return (
<section className="perf-section" ref={ref}>
<span className="section-eyebrow">benchmarks</span>