Closed slava-lu closed 3 years ago
Looks like I just needed to wrap a child component in React.forwardRef
Sorry for the late response. I don't think you were waiting for my help since you found the correct answer for your problem :)
forwardRef
is the function you are searched for ))
I wanted to update your HOC example with the parent component (ParentDiv):
But it did not work for me because I still get the width of the ParentDiv, rather than the child div I attach ref to.