score:4

Accepted answer

What does the reference myDivElement.current points to exactly

myDivElement.current receives the reference to the underlying DOM element

Can I say that what I get in myDivElement.current object is one of the type HTMLElement

When you assign ref to a div element, myDivElement.current will be of type HTMLDivElement

myDivElement.current is being initialized with null value. When does that change to the reference of the div? Does it happen after 1st render?

During first render, the ref object is being assigned to the DOMNode when its created. Updates to DOM node will lead to a change in the object as well


Related Query

More Query from same tag