I don't understand. How is it not a node if the finalGContainer was succesfully created using the "createElement" function?
as pointed out in the comments previously, createElement
does not create a DOM node. When you console log finalGContainer
you'll see it's a Symbol instead of a <g>
SVG element
In order append finalGContainer
as a child of the SVG, you have two options
root.render(finalGContainer)
finalGContainer
to a string of HTMLconst htmlStr = ReactDOMServer.renderToString(finalGContainer)
const domNode = new DOMParser().parseFromString(htmlStr, 'text/html').body.firstChild
svg.appendChild(domNode)