I am using react and typescript. I wanted to get the height of the div tag, so I used useRef. However, I get a ts error in current.
Property 'current' is not present in type 'never'. ts(2339)
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
if (ref != null || ref.current != null) {
setHeight(ref.current.clientHeight);
}
}, [user]);