gorangajic / react-svg-morph

:crystal_ball: morph your svg component one into another other

Home Page:http://gorangajic.github.io/react-svg-morph/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: operate on specific elements in an svg

brmscheiner opened this issue · comments

At the moment, attempting to morph inner svg elements gives an error. For example

<MorphReplace>
    <path
        key={this.pathKey}
        d={pathDefinition}
        className={curveStyles}
    />
</MorphReplace>

results in Uncaught TypeError: Cannot read property 'children' of undefined (caught in normizeSvg.js because findSvgRoot returns undefined).

Allowing this would be cool for applications such as data visualization. In my case animation is already handled for other svg elements and I just want to morph one particular path.

Same issue here, i'm inserting SVG element using dangerouslySetInnerHTML due to a cluncky backend architecture.

I've found a workaround, not as clean as I'd wished, thanks a lot for your work tho ;)