I need to create an HTML element and provide it to some third-party component.
const testElement =
thirdParty.addElement(testElement)
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.
Is there a way to convert testElement to a DOM element?
That said, I'm looking for a solution that will retain event handlers etc' associated with the component, so simply converting to HTML (ReactDOMServer.renderToString(testElement)) doesn't cut it.
-
Edit regarding duplicate:
The other one discusses about the HTML string. I need the object along with its event handlers etc'.