SVG 转 JSX
将 SVG 代码转换为 React JSX 组件,自动替换属性名为驼峰形式
转换结果
—
💡 提示:转换器会自动完成以下处理:
·
· 连字符属性(如
·
· 保留
· 使用
·
class → className;· 连字符属性(如
stroke-width)→ 驼峰形式(strokeWidth);·
xlink:href → href,并移除多余的 xmlns:xlink;· 保留
xmlns 与 viewBox 等必要属性;· 使用
{...props} 支持透传属性。