导入react-trianglify时出现意外令牌

时间:2018-10-18 11:45:26

标签: javascript reactjs trianglify

我在尝试导入和使用react-trianglify时陷入困境。

将其导入组件时

import Trianglify from "react-trianglify";

我收到以下错误:

Failed to compile.

./node_modules/react-trianglify/src/index.js
SyntaxError: C:\Users\kevin\react\squanchy_dev\node_modules\react-trianglify\src\index.js: Unexpected token (39:10)

  37 |         method: 'generateCanvas',
  38 |         component: ({ canvasRef, height, width }) => (
> 39 |           <canvas ref={canvasRef} height={height} width={width} />
     |           ^
  40 |         )
  41 |       },
  42 |

有人知道如何解决此问题吗?

0 个答案:

没有答案