Skip to content

Commit f3744b4

Browse files
committed
Adding latest build
2 parents e7d91e8 + cc4edfb commit f3744b4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ npm install html-to-draftjs --save
1111

1212
## Using
1313
```
14+
import { EditorState, ContentState } from 'draft-js';
1415
import htmlToDraft from 'html-to-draftjs';
1516
1617
const blocksFromHTML = htmlToDraft(this.props.content);
17-
const contentState = ContentState.createFromBlockArray(blocksFromHTML);
18+
const contentBlocks = blocksFromHtml.contentBlocks;
19+
const contentState = ContentState.createFromBlockArray(contentBlocks);
1820
const editorState = EditorState.createWithContent(contentState);
1921
```

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"devDependencies": {
1010
"babel-preset-es2015": "^6.22.0",
11+
"babel-preset-react": "^6.23.0",
1112
"babel-preset-stage-0": "^6.22.0",
1213
"chai": "^3.5.0",
1314
"draft-js": "^0.10.0",

0 commit comments

Comments
 (0)