Skip to content

React doesn't correctly re-render dynamically created Components added to an <svg> via state #10659

@davidhatten

Description

@davidhatten

Do you want to request a feature or report a bug?
I believe I am reporting a bug

What is the current behavior?
When I have a dynamic tag named through a const, the element attributes will be parsed correctly, but the tag name won't be resolved all the way down to it's react component and thus, won't be rendered.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/ebsrpraL/).

https://jsfiddle.net/ebsrpraL/1/

Click in the SVG box. A tag appears in the svg DOM with its attributes looking like html (with dashes instead of camelCase).

What is the expected behavior?
If you change "ShapeTag" to "Circle", things work as intended and another circle appears.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Bash on Ubuntu on Windows in Chrome

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