我在尝试导入和使用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 |
有人知道如何解决此问题吗?