title: How to convert React element to dom element
body: <p>I need to create an HTML element and provide it to some third-party component.</p>
  
  <pre><code>const testElement = &lt;div ref='myself' className='test-label'&gt;Hello (React) HTML element!&lt;/div&gt;
  thirdParty.addElement(testElement)
  </code></pre>
  
  <p>In the above I create the element with React, but passing it on as said raises an error, obviously because it's a React element and not a native DOM element.</p>
  
  <p><strong>Is there a way to convert <code>testElement</code> to a DOM element?</strong></p>
  
  <p>That said, I'm looking for a solution that will <strong>retain event handlers etc'</strong> associated with the component, so simply converting to HTML (<code>ReactDOMServer.renderToString(testElement)</code>) doesn't cut it.</p>
  
  <p>-</p>
  
  <p>Edit regarding duplicate:</p>
  
  <p>The other one discusses about the HTML string. I need the object along with its event handlers etc'.</p>