Skip to content

dangerouslySetInnerHTML not working in SVG elements on Edge browser #7506

@jasford

Description

@jasford

This appears to be a bug in React with the Microsoft Edge browser. This was previously a bug in older Internet Explorer browsers as well, but appears to have been fixed by #6982 – unfortunately the fix did not resolve the issue in Edge.

I modified the codepen from the original issue to use React 15.3.0, which includes the above-referenced pull request, and demonstrates the bug in Edge:
http://codepen.io/anon/pen/QEYoLV

Here is the output of that Codepen in IE 11 – this is the expected behavior as innerHTML is not available in Internet Explorer, yet React 15.3 is still able to function:

image

And here is the output of the same Codepen in Edge 38:

image

The problem seems to be that Edge has innerHTML, so it does not use the IE workaround code, yet Edge does not appear to be refreshing the DOM after updating – at least I can see the SVG contents added to the DOM using Inspect Element, but they are not visible in the browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions