1import React, { Component } from 'react'
2import { EditorState, ContentState, convertFromHTML } from 'draft-js'
3import { Editor } from 'react-draft-wysiwyg'
4
5class MyEditor extends Component {
6 constructor(props) {
7 super(props)
8 this.state = {
9 editorState: EditorState.createWithContent(
10 ContentState.createFromBlockArray(
11 convertFromHTML('<p>My initial content.</p>')
12 )
13 ),
14 }
15 }
16
17 render() {
18 return <Editor editorState={this.state.editorState} />
19 }
20}
21
22export default MyEditor