Skip to content

Commit 4b72ea5

Browse files
authored
Grab contentBlocks from output of htmlToDraft
Your example was correct in the playground code - looks like readme just missed a step. :)
1 parent de791f6 commit 4b72ea5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ npm install html-to-draftjs --save
1414
import htmlToDraft from 'html-to-draftjs';
1515
1616
const blocksFromHTML = htmlToDraft(this.props.content);
17-
const contentState = ContentState.createFromBlockArray(blocksFromHTML);
17+
const contentBlocks = blocksFromHtml.contentBlocks;
18+
const contentState = ContentState.createFromBlockArray(contentBlocks);
1819
const editorState = EditorState.createWithContent(contentState);
1920
```

0 commit comments

Comments
 (0)