preact-render-to-string
preact-render-to-string copied to clipboard
SVG attributes format
Not sure if this an issue or a clarification.
If I have some SVG, such as
<path d="M 2 50 A 48 48 0 0 1 50 2" stroke="#gradLeft-1" strokeWidth="4" fill="none" />
It doesn't work correctly.
If I change 'strokeWidth' to 'stroke-width' (changed to lower case with a dash) then it does work ok.
This is different to react.
Is this behaviour correct? or have I done something wrong?
Ah yeah this looks like an issue. In preact it's more common to use the attribute names, but we do officially support both. We'll need to convert them :)
Great - good to know I wasn't being stupid!
hello everybody, any progress in this issue? I just stumbled in the same problem
maybe the same issue.
current version support http-equiv but not httpEquiv.
support charset but not charSet.
Ah yeah this looks like an issue. In preact it's more common to use the attribute names, but we do officially support both. We'll need to convert them :)
react-dom has a file possibleStandardNames.js that can be used to normalize attributes:
https://github.com/facebook/react/blob/ca106a02d1648f4f0048b07c6b88f69aac175d3c/packages/react-dom/src/shared/possibleStandardNames.js
cc @developit