my code
1import React, { Component } from "react";
2import { Editor, EditorState } from "draft-js";
3
4export default class SimpleStaticToolbarEditor extends Component {
5 state = {
6 editorState: EditorState.createEmpty(),
7 };
8
9 onChange = (editorState) => {
10 this.setState({
11 editorState,
12 });
13 };
14
15 render() {
16 return (
17 <div>
18 <div>
19 <Editor
20 editorState={this.state.editorState}
21 onChange={this.onChange}
22 />
23 </div>
24 </div>
25 );
26 }
27}