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 de791f6 + 6c486f3 commit 4ade31bCopy full SHA for 4ade31b
README.md
@@ -11,9 +11,10 @@ npm install html-to-draftjs --save
11
12
## Using
13
```
14
+import { EditorState, ContentState } from 'draft-js';
15
import htmlToDraft from 'html-to-draftjs';
16
-const blocksFromHTML = htmlToDraft(this.props.content);
17
-const contentState = ContentState.createFromBlockArray(blocksFromHTML);
+const contentBlock = htmlToDraft(html);
18
+const contentState = ContentState.createFromBlockArray(contentBlock.contentBlocks);
19
const editorState = EditorState.createWithContent(contentState);
20
0 commit comments