I'm accessing a reason-react DOM reference in order to ascertain client height.
Unfortunately clientHeight doesn't seem to be part of the ref API. So this fails:
ref
-> React.Ref.current
-> Js.Nullable.toOption
-> Belt.Option.map(this => {
React.Ref.clientHeight(this);
});
The value clientHeight can't be found in React.Ref.
Is there a way to extract the height of a component from the ref?
The ref was acquired from a div.
Assuming you acquired the ref from either
ReactDOMRe.Ref.domReforReactDOMRe.Ref.callbackDomRef, you will receive aDom.elementand can useElement.clientHeightfrombs-webapi: