File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 1
- #HTML to DraftJS
1
+ # HTML To DraftJS
2
2
3
- Build for use with editor library [ react-draft-wysiwyg] ( https://github.com/jpuri/react-draft-wysiwyg )
3
+ A library for converting to plain HTML DraftJS Editor content.
4
+ Build for use with editor library react-draft-wysiwyg
4
5
5
- ## To setup
6
- - ` yarn ` or ` npm install `
6
+ ## Installing
7
7
8
- ## To start running playground
9
- - ` npm start `
8
+ ```
9
+ npm install html-to-draftjs --save
10
+ ```
10
11
11
- ## To build
12
- - ` num run build `
12
+ ## Using
13
+ ```
14
+ import htmlToDraft from 'html-to-draftjs';
15
+
16
+ const blocksFromHTML = htmlToDraft(this.props.content);
17
+ const contentState = ContentState.createFromBlockArray(blocksFromHTML);
18
+ const editorState = EditorState.createWithContent(contentState);
19
+ ```
You can’t perform that action at this time.
0 commit comments