Why React ref return Ant? How to use it?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Why React ref return Ant? How to use it?



My code like this


render() {
return (
<div>
<Layout ref={element => this.ipDetailDOM = element} id="ip-detail">
...
</layout>
</div>
)
}



But this.ipDetailDOM return an Adapter Object.


this.ipDetailDOM


Adapter


Adapter {props: {…}, context: {…}, refs: {…}, updater: {…}, _reactInternalFiber: FiberNode, …}



I do not know to use it?





How does the layout component look like, also , it it created using an HOC
– Shubham Khatri
24 mins ago





How did you create the ref? using createRef()?
– Abinthaha
18 mins ago


ref


createRef()




1 Answer
1



You can use ReactDOM.findDOMNode(this.ipDetailDOM) to access the underlying DOM node.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived