我正在尝试将 GrapesJS 功能与我的 React APP 集成。
I get an error while implementing like `Uncaught TypeError: Cannot read property 'forEach' of undefined grapesjs react`
I would like to have a feature like in this URL
https://grapesjs.com/demo.html
npm i grapesjs-react
import React, {Component} from 'react';
import GEditor from 'grapesjs-react';
class GEditorExample extends Component {
render() {
return (
<GEditor/>
);
}
}
export default GEditorExample;
- 如何为我的 React 应用程序获取此功能以构建 HTML Web Builder。
任何帮助都会很棒。 谢谢。*
最佳答案
你必须指定 blocks 属性,这个 block 将通过 grapes-js 的 blockmanager.add
方法添加到编辑器中。
如果不需要 block ,请尝试提供一个空数组,例如:
<GEditor id="gjs" blocks={[]} />
关于javascript - 将 GrapesJS 与 React JS 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57566967/