Skip to content

Commit effa968

Browse files
author
Julian Krispel-Samsel
committed
use convertFromRaw
1 parent a09957c commit effa968

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/App.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { EditorState, Editor } from 'draft-js';
2+
import { EditorState, Editor, convertToRaw } from 'draft-js';
33

44
class App extends Component {
55
constructor(props) {
@@ -10,6 +10,8 @@ class App extends Component {
1010
}
1111

1212
onChange = (editorState) => {
13+
const contentState = editorState.getCurrentContent();
14+
console.log('content state', convertToRaw(contentState));
1315
this.setState({
1416
editorState,
1517
});

0 commit comments

Comments
 (0)