svg-inline-react
svg-inline-react copied to clipboard
'remove' method used in 'getSVGFromSource' is not supported by IE
The remove
method used by getSVGFromSource
when using the raw
prop option is not supported by IE (I have tested this with IE 11).
See remove
browser compatibility table here: https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove
A possible solution might be to check if remove
is defined, otherwise use the more broadly supported removeChild
as such:
svg.remove ? svg.remove() : svgContainer.removeChild(svg); // deref from parent element
@diegocasmo Consider using a polyfill on your end? ChildNode.remove() method in Internet Explorer 9 and higher.