我已经尝试过使用componentWillMount和componentDidMount从React的上下文中初始化CKEditor,但是无论我尝试哪种组合,它似乎都不起作用。除了切换编辑器之外,还有人找到解决方案吗?
我在Npm上发布了一个将CKEditor与React结合使用的软件包。只需1行代码即可集成到您的项目中。
Github上的链接- https://github.com/codeslayer1/react- ckeditor。
如何使用?
npm install react-ckeditor-component --save
<CKEditor activeClass="editor" content={this.state.content} onChange={this.updateContent} />
该软件包使用CKEditor的默认版本,但您也可以使用自定义版本以及所需的任何插件。它还包括一个示例应用程序。希望您会发现它有用。