-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
27 lines (26 loc) · 690 Bytes
/
Copy pathApp.js
File metadata and controls
27 lines (26 loc) · 690 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
25
26
27
import React, {useState} from 'react';
import logo from './logo.svg';
import './App.css';
import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import parse from 'html-react-parser'
function App() {
const[text, setText] = useState('')
return (
<div className="App">
<div className="editor">
<CKEditor
editor = {ClassicEditor}
data = {text}
onChange = {(event, editor) => { const data = editor.getData()
setText(data)}}
/>
</div>
<div>
<h2>Content</h2>
<p>{parse(text)}</p>
</div>
</div>
);
}
export default App;