We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4ade31b + 43120eb commit 5d18feeCopy full SHA for 5d18fee
README.md
@@ -14,7 +14,8 @@ npm install html-to-draftjs --save
14
import { EditorState, ContentState } from 'draft-js';
15
import htmlToDraft from 'html-to-draftjs';
16
17
-const contentBlock = htmlToDraft(html);
18
-const contentState = ContentState.createFromBlockArray(contentBlock.contentBlocks);
+const blocksFromHTML = htmlToDraft(this.props.content);
+const contentBlocks = blocksFromHtml.contentBlocks;
19
+const contentState = ContentState.createFromBlockArray(contentBlocks);
20
const editorState = EditorState.createWithContent(contentState);
21
```
0 commit comments