react-svg-morph icon indicating copy to clipboard operation
react-svg-morph copied to clipboard

Invalid DOM property for dash-case SVG attributes, such as stroke-width

Open csepulv opened this issue 6 years ago • 0 comments

If your SVG component has properties like stroke-width, you get the following console warning.

Warning: Invalid DOM property `stroke-width`. Did you mean `strokeWidth`?
    in path (created by MorphTransition)
    in svg (created by MorphTransition)
    in MorphTransition (created by MorphReplace)
    in MorphReplace (created by App)
    in div (created by App)
    in App

It would seem strokeWidth (camelCase) should be used instead, but helpers.js and normalizeSvg.js expect the dash-case versions.

Is there a reason it doesn't use camelCase, as would seem more typical in React? Any idea on how to get rid of the warning?

csepulv avatar Jun 13 '19 02:06 csepulv