I'm trying to use Element.getBoundingClientRect() to get the x, y, top, left value of dom element.
const editorRef = useRef()
... // attatched editor ref on the dom element that I'm interested
...
editorRef.current.focus() // works well
const editorNodeRect = editorRef.current.getBoundingClientRect() // got error saying getBoundingClientRect() is not a function
so I tried this way by select the node by query
const editorNodebyQuery =document.querySelectorAll(".DraftEditor-root")[0];
const editorNodebyQueryRect = editorNodebyQuery.getBoundingClientRect() // work well!!
but I don't like to access the dom node by query.. I think it's heavy.. I want to use the useRef.
first rootEditorNode is what I got by querySelector and it have getBoundingClientRect() function second editorRef.current is what i got by useRef and it doesnt have getBoundingClientRect() funcion.
I just want to know how to use getBoundingClientRect() function with useRef()
