-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
24 lines (23 loc) · 915 Bytes
/
App.js
File metadata and controls
24 lines (23 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import * as React from 'react';
import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import CKEditorInspector from '@ckeditor/ckeditor5-inspector';
import './style.css';
export default function App() {
return (
<div className="App">
<CKEditor
editor={ ClassicEditor }
data="<p>Hello from CKEditor 5!</p><h1>See inpector in action</h1><ul><li>Check the Model</li><li>See the View (output)</li><li>Check available commands</li></ul>"
onReady={ editor => {
console.log( 'CKEditor React Component is ready to use!', editor );
CKEditorInspector.attach( editor );
} }
onChange={ ( event, editor ) => {
const data = editor.getData();
console.log( { event, editor, data } );
} }
/>
</div>
);
}