我尝试在我的代码盒中实现 rete.js 可视化编程框架,并在我的 canvas.js 文件中使用以下代码:
import "../../styles.css";
import { createEditor } from "../../rete";
function Canvas() {
return (
<div className="App">
<div
style={{ width: "100vw", height: "100vh" }}
ref={ref => ref && createEditor(ref)}/>
</div>
);
}
export default Canvas;
浏览器显示以下错误消息:
rete.createEditor is not a function
ref
/src/components/layout/Canvas.js:10:40
7 | <div className="App">
8 | <div
9 | style={{ width: "100vw", height: "100vh" }}
> 10 | ref={ref => ref && createEditor(ref)}/>
| ^
11 | </div>
12 | );
13 | }
你能在这里找出我的错误吗?