javascript - React.js。错误: Invalid value for <path> attribute d

标签 javascript svg reactjs coffeescript snap.svg

我想在 React 组件中添加 SVG。我使用没有 JSX 的 CoffeeScript:

svg viewbox: '0 0 800 600',
   path 
      id: 'top'
      d: 'M300,220 C300,220 520,220 540,220 C740,220 640,540'

我收到此错误:

Error: Invalid value for <path> attribute d="M300,220 C300,220 520,220 540,220 C740,220 640,540"

最佳答案

看起来很合理,a cubic bezier defined using the C command must have 6 values following it但你的最后一个只有 4。

关于javascript - React.js。错误: Invalid value for <path> attribute d,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36706913/

相关文章:

javascript - 通知: Undefined variable picture,性别

swift - 将 SVG 字符串加载到 UIImage (Swift)

html - 在 <img> 标签中使用非 `.svg` 扩展名的 SVG 图像

javascript - 如何使用 styled-components 为我自己的组件(响应式标题)设置样式?

javascript - 视频 JS 范围 slider 不起作用

javascript - 如何在 React 组件中运行计时器 60 秒并每 5 秒调用一次 Redux 操作

php - 变量未传递到 javascript 和 php

javascript - jquery x-可编辑数字输入

javascript - 如何根据函数参数在 D3 中添加半圆?

d3.js - d3 单击圆圈暂停并恢复标记沿线的过渡