arrow_backBACK TO DRILLS
Blue Belt - MediumuserefPREMIUM
useRef Called with No Argument for a DOM Ref
A developer calls useRef() with no argument and passes the result to a div's ref prop in a TypeScript file.
//REACT_MODULE
const divRef = useRef();
return <div ref={divRef} />;Why does TypeScript reject this, and what is the correct way to declare the ref?