Refactor the element creation logic (during command creation or in JS script) to propagate the SVG namespace URI from parent to child instead of relying on a hard-coded tag lookup list.
When an tag is encountered, initiate the SVG namespace and ensure all descendants inherit it automatically, reverting to the HTML namespace only when entering a . This eliminates hydration bugs and ensures all nested elements are correctly instantiated as SVGElement types, making the library future-proof and more performant.
Refactor the element creation logic (during command creation or in JS script) to propagate the SVG namespace URI from parent to child instead of relying on a hard-coded tag lookup list.
When an tag is encountered, initiate the SVG namespace and ensure all descendants inherit it automatically, reverting to the HTML namespace only when entering a . This eliminates hydration bugs and ensures all nested elements are correctly instantiated as SVGElement types, making the library future-proof and more performant.