79530031

Date: 2025-03-24 02:38:10
Score: 0.5
Natty:
Report link

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

const htmlStr = ReactDOMServer.renderToString(finalGContainer)
const domNode = new DOMParser().parseFromString(htmlStr, 'text/html').body.firstChild
svg.appendChild(domNode)
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: fitsum