Skip to content

Commit 9be3aa7

Browse files
author
Rose
authored
Update example to use correct editorState
Using `this.state.editorState` is incorrect as the setState line before is asynchronous. Fixed after a PR was opened pointing out the issue here: Rosey#121
1 parent 1b64493 commit 9be3aa7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ constructor(props) {
6666
this.setState({ editorState });
6767

6868
// Convert draftjs state to markdown
69-
const content = this.state.editorState.getCurrentContent();
69+
const content = editorState.getCurrentContent();
7070
const rawObject = convertToRaw(content);
7171
const markdownString = draftToMarkdown(rawObject);
7272

0 commit comments

Comments
 (0)