I'm using useRef to reference a div element and storing getBoundingClientRect(). Upon using it, I get a TypeScript error of Property 'height' does not exist on type 'string'. How do I address this error?
const divRef = useRef(null);
const [divSize, setDivSize] = useState("0");
setDivSize(divRef.current.getBoundingClientRect());
console.log(divSize.height); // getting TS error: Property 'height' does not exist on type 'string'.
return (
<Content ref={divRef}>
{content}
</Content>
)