React.js. Error: Invalid value for <path> attribute d

React.js. Error: Invalid value for <path> attribute d

我想在 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 个。