← React Beginner Questions - Set 8 Q78

What are React refs used for?

React Beginner Questions - Set 8

Example

const boxRef = useRef(null);
useEffect(() => { boxRef.current.scrollIntoView(); }, []);
return <div ref={boxRef}>…</div>;

What to notice

← Back to the question list