I want to both insert HTML into CKEditor text area from a variable (when pressing a button), and save CK text inside the editor to a variable (by the press of another button) in order to send it to a database. As it looks like in the console it's not regular html according to the picture below. How can I achieve this?
import React, { Component } from "react";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import ListAll from "./components/ListAll";
class App extends Component {
render() {
return (
<div className="App">
<Toolbar>
<ListAll />
</Toolbar>
<h2>Using CKEditor 5 build in React</h2>
<CKEditor
editor={ClassicEditor}
id="ckeditor"
data="<p>Hello from CKEditor 5!</p>"
onReady={(editor) => {
// You can store the "editor" and use when it is needed.
console.log("Editor is ready to use!", editor);
}}
/>
</div>
);
}
}
export default App;