@@ -30,9 +30,11 @@ class Playground extends Component {
30
30
}
31
31
32
32
onInputEditorChange = ( inputEditorState ) => {
33
- console . log ( '*****' , inputEditorState . getCurrentContent ( ) )
33
+ console . log ( 'into onInputEditorChange' )
34
+ // console.log('*****', inputEditorState.getCurrentContent())
34
35
const rawContent = convertToRaw ( inputEditorState . getCurrentContent ( ) ) ;
35
36
const html = draftToHtml ( rawContent ) ;
37
+ console . log ( 'html' , html )
36
38
const contentBlock = htmlToDraft ( html ) ;
37
39
// console.log('1', contentBlock)
38
40
// console.log('2', convertFromHTML(html) && convertFromHTML(html))
@@ -43,8 +45,8 @@ class Playground extends Component {
43
45
inputEditorState,
44
46
outputEditorState,
45
47
} ) ;
46
- console . log ( '1' , inputEditorState . getCurrentContent ( ) . getBlocksAsArray ( ) )
47
- console . log ( '2' , contentBlock . contentBlocks )
48
+ // console.log('1', inputEditorState.getCurrentContent().getBlocksAsArray())
49
+ // console.log('2', contentBlock.contentBlocks)
48
50
}
49
51
}
50
52
@@ -76,10 +78,13 @@ class Playground extends Component {
76
78
< textarea
77
79
disabled
78
80
className = "demo-content"
81
+ value = { this . state . inputEditorState && draftToHtml ( convertToRaw ( this . state . inputEditorState . getCurrentContent ( ) ) ) }
79
82
/>
80
83
</ div >
81
84
< div style = { { height : 200 } } >
82
-
85
+ < Editor
86
+ editorState = { this . state . outputEditorState }
87
+ />
83
88
</ div >
84
89
</ div >
85
90
) ;
0 commit comments